CanvasAnvil is an open source AI diagram maker and flowchart generator - an infinite-canvas diagram editor and self-hosted drawio alternative that writes editable .drawio files. Text to diagram, then fix nodes, layout and labels in place. Also AI presentations, interior design CAD/BOM, posters and infographics.
TypeScript ai-agentsai-diagramai-presentationbomcadcanvasdiagramdiagram-generatordrawioflowchartinfographicspptppt-generatorpresentation-generatorreactsvgedittext-to-diagramtypescriptworkflow
feat: add local workflow skills and update docs
codingFeng10185d5a289e6df
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 8eb8b13..f459a97 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -4,6 +4,36 @@ All notable changes to this project will be documented in this file.The format is based on Keep a Changelog, and the project aims to follow Semantic Versioning.+## [2.0.0] - 2026-04-22++### Added++- Added three new canvases: `Poster`, `Infographic`, and `Product`.+- Embedded `pptist-lab` directly inside the PPT workspace for editable PPT authoring.+- Added a staged editable PPT review flow with automatic text-box detection, manual box correction, text extraction, and per-slide re-extraction.+- Added local skill definitions for `Flow`, `CAD`, `PPT`, `Poster`, `Infographic`, and `Product` workflows under `skill/`.+- Added configurable image-provider support for image-generation skills via `config/image-provider.json`, covering the supported built-in providers.+- Added script-backed skill workflows for image generation, diagram export, CAD output bundling, PPT template generation, slide image rendering, PDF export, and image-based PPT export.++### Changed++- Promoted the release version from `1.0.2` to the next major release, `2.0.0`.+- Expanded CanvasAnvil from `Flow | CAD | PPT` to `Flow | CAD | PPT | Poster | Infographic | Product`.+- Updated editable PPT export to separate `text box review`, `text extraction`, and `start editing`.+- Kept both the original slide image and the derived `textless background` version available during review.+- Improved extracted text mapping so the embedded PPT editor keeps more of the original size, color, weight, spacing, alignment, and line-height.+- Reduced repository documentation to English and Simplified Chinese only.+- Standardized skill prompts and `SKILL.md` files around English instructions while keeping UI-language-specific output labels where needed.+- Simplified the PPT skill export scope to `PDF` and image-based `PPT` deliverables.+- Updated the CAD skill BOM output contract to produce `cad_bom.csv` instead of `cad_bom.json`.+- Updated the Flow skill bundle workflow to skip standalone HTML preview generation by default.++### Fixed++- Fixed editable PPT export popup blocking by switching to an embedded editor flow.+- Fixed oversized editable-export bootstrap payloads that previously overflowed browser storage.+- Fixed review-mode state issues around text-box preparation, extraction progress, per-slide re-extraction visibility, and version switching.+## [1.0.2] - 2026-04-15### Changeddiff --git a/LICENSE b/LICENSEindex a0a5b08..be3f7b2 100644--- a/LICENSE+++ b/LICENSE@@ -1,21 +1,661 @@-MIT License--Copyright (c) 2026 CodingFeng101--Permission is hereby granted, free of charge, to any person obtaining a copy-of this software and associated documentation files (the "Software"), to deal-in the Software without restriction, including without limitation the rights-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell-copies of the Software, and to permit persons to whom the Software is-furnished to do so, subject to the following conditions:--The above copyright notice and this permission notice shall be included in all-copies or substantial portions of the Software.--THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE-SOFTWARE.+ GNU AFFERO GENERAL PUBLIC LICENSE+ Version 3, 19 November 2007++ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>+ Everyone is permitted to copy and distribute verbatim copies+ of this license document, but changing it is not allowed.++ Preamble++ The GNU Affero General Public License is a free, copyleft license for+software and other kinds of works, specifically designed to ensure+cooperation with the community in the case of network server software.++ The licenses for most software and other practical works are designed+to take away your freedom to share and change the works. By contrast,+our General Public Licenses are intended to guarantee your freedom to+share and change all versions of a program--to make sure it remains free+software for all its users.++ When we speak of free software, we are referring to freedom, not+price. Our General Public Licenses are designed to make sure that you+have the freedom to distribute copies of free software (and charge for+them if you wish), that you receive source code or can get it if you+want it, that you can change the software or use pieces of it in new+free programs, and that you know you can do these things.++ Developers that use our General Public Licenses protect your rights+with two steps: (1) assert copyright on the software, and (2) offer+you this License which gives you legal permission to copy, distribute+and/or modify the software.++ A secondary benefit of defending all users' freedom is that+improvements made in alternate versions of the program, if they+receive widespread use, become available for other developers to+incorporate. Many developers of free software are heartened and+encouraged by the resulting cooperation. However, in the case of+software used on network servers, this result may fail to come about.+The GNU General Public License permits making a modified version and+letting the public access it on a server without ever releasing its+source code to the public.++ The GNU Affero General Public License is designed specifically to+ensure that, in such cases, the modified source code becomes available+to the community. It requires the operator of a network server to+provide the source code of the modified version running there to the+users of that server. Therefore, public use of a modified version, on+a publicly accessible server, gives the public access to the source+code of the modified version.++ An older license, called the Affero General Public License and+published by Affero, was designed to accomplish similar goals. This is+a different license, not a version of the Affero GPL, but Affero has+released a new version of the Affero GPL which permits relicensing under+this license.++ The precise terms and conditions for copying, distribution and+modification follow.++ TERMS AND CONDITIONS++ 0. Definitions.++ "This License" refers to version 3 of the GNU Affero General Public License.++ "Copyright" also means copyright-like laws that apply to other kinds of+works, such as semiconductor masks.++ "The Program" refers to any copyrightable work licensed under this+License. Each licensee is addressed as "you". "Licensees" and+"recipients" may be individuals or organizations.++ To "modify" a work means to copy from or adapt all or part of the work+in a fashion requiring copyright permission, other than the making of an+exact copy. The resulting work is called a "modified version" of the+earlier work or a work "based on" the earlier work.++ A "covered work" means either the unmodified Program or a work based+on the Program.++ To "propagate" a work means to do anything with it that, without+permission, would make you directly or secondarily liable for+infringement under applicable copyright law, except executing it on a+computer or modifying a private copy. Propagation includes copying,+distribution (with or without modification), making available to the+public, and in some countries other activities as well.++ To "convey" a work means any kind of propagation that enables other+parties to make or receive copies. Mere interaction with a user through+a computer network, with no transfer of a copy, is not conveying.++ An interactive user interface displays "Appropriate Legal Notices"+to the extent that it includes a convenient and prominently visible+feature that (1) displays an appropriate copyright notice, and (2)+tells the user that there is no warranty for the work (except to the+extent that warranties are provided), that licensees may convey the+work under this License, and how to view a copy of this License. If+the interface presents a list of user commands or options, such as a+menu, a prominent item in the list meets this criterion.++ 1. Source Code.++ The "source code" for a work means the preferred form of the work+for making modifications to it. "Object code" means any non-source+form of a work.++ A "Standard Interface" means an interface that either is an official+standard defined by a recognized standards body, or, in the case of+interfaces specified for a particular programming language, one that+is widely used among developers working in that language.++ The "System Libraries" of an executable work include anything, other+than the work as a whole, that (a) is included in the normal form of+packaging a Major Component, but which is not part of that Major+Component, and (b) serves only to enable use of the work with that+Major Component, or to implement a Standard Interface for which an+implementation is available to the public in source code form. A+"Major Component", in this context, means a major essential component+(kernel, window system, and so on) of the specific operating system+(if any) on which the executable work runs, or a compiler used to+produce the work, or an object code interpreter used to run it.++ The "Corresponding Source" for a work in object code form means all+the source code needed to generate, install, and (for an executable+work) run the object code and to modify the work, including scripts to+control those activities. However, it does not include the work's+System Libraries, or general-purpose tools or generally available free+programs which are used unmodified in performing those activities but+which are not part of the work. For example, Corresponding Source+includes interface definition files associated with source files for+the work, and the source code for shared libraries and dynamically+linked subprograms that the work is specifically designed to require,+such as by intimate data communication or control flow between those+subprograms and other parts of the work.++ The Corresponding Source need not include anything that users+can regenerate automatically from other parts of the Corresponding+Source.++ The Corresponding Source for a work in source code form is that+same work.++ 2. Basic Permissions.++ All rights granted under this License are granted for the term of+copyright on the Program, and are irrevocable provided the stated+conditions are met. This License explicitly affirms your unlimited+permission to run the unmodified Program. The output from running a+covered work is covered by this License only if the output, given its+content, constitutes a covered work. This License acknowledges your+rights of fair use or other equivalent, as provided by copyright law.++ You may make, run and propagate covered works that you do not+convey, without conditions so long as your license otherwise remains+in force. You may convey covered works to others for the sole purpose+of having them make modifications exclusively for you, or provide you+with facilities for running those works, provided that you comply with+the terms of this License in conveying all material for which you do+not control copyright. Those thus making or running the covered works+for you must do so exclusively on your behalf, under your direction+and control, on terms that prohibit them from making any copies of+your copyrighted material outside their relationship with you.++ Conveying under any other circumstances is permitted solely under+the conditions stated below. Sublicensing is not allowed; section 10+makes it unnecessary.++ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.++ No covered work shall be deemed part of an effective technological+measure under any applicable law fulfilling obligations under article+11 of the WIPO copyright treaty adopted on 20 December 1996, or+similar laws prohibiting or restricting circumvention of such+measures.++ When you convey a covered work, you waive any legal power to forbid+circumvention of technological measures to the extent such circumvention+is effected by exercising rights under this License with respect to+the covered work, and you disclaim any intention to limit operation or+modification of the work as a means of enforcing, against the work's+users, your or third parties' legal rights to forbid circumvention of+technological measures.++ 4. Conveying Verbatim Copies.++ You may convey verbatim copies of the Program's source code as you+receive it, in any medium, provided that you conspicuously and+appropriately publish on each copy an appropriate copyright notice;+keep intact all notices stating that this License and any+non-permissive terms added in accord with section 7 apply to the code;+keep intact all notices of the absence of any warranty; and give all+recipients a copy of this License along with the Program.++ You may charge any price or no price for each copy that you convey,+and you may offer support or warranty protection for a fee.++ 5. Conveying Modified Source Versions.++ You may convey a work based on the Program, or the modifications to+produce it from the Program, in the form of source code under the+terms of section 4, provided that you also meet all of these conditions:++ a) The work must carry prominent notices stating that you modified+ it, and giving a relevant date.++ b) The work must carry prominent notices stating that it is+ released under this License and any conditions added under section+ 7. This requirement modifies the requirement in section 4 to+ "keep intact all notices".++ c) You must license the entire work, as a whole, under this+ License to anyone who comes into possession of a copy. This+ License will therefore apply, along with any applicable section 7+ additional terms, to the whole of the work, and all its parts,+ regardless of how they are packaged. This License gives no+ permission to license the work in any other way, but it does not+ invalidate such permission if you have separately received it.++ d) If the work has interactive user interfaces, each must display+ Appropriate Legal Notices; however, if the Program has interactive+ interfaces that do not display Appropriate Legal Notices, your+ work need not make them do so.++ A compilation of a covered work with other separate and independent+works, which are not by their nature extensions of the covered work,+and which are not combined with it such as to form a larger program,+in or on a volume of a storage or distribution medium, is called an+"aggregate" if the compilation and its resulting copyright are not+used to limit the access or legal rights of the compilation's users+beyond what the individual works permit. Inclusion of a covered work+in an aggregate does not cause this License to apply to the other+parts of the aggregate.++ 6. Conveying Non-Source Forms.++ You may convey a covered work in object code form under the terms+of sections 4 and 5, provided that you also convey the+machine-readable Corresponding Source under the terms of this License,+in one of these ways:++ a) Convey the object code in, or embodied in, a physical product+ (including a physical distribution medium), accompanied by the+ Corresponding Source fixed on a durable physical medium+ customarily used for software interchange.++ b) Convey the object code in, or embodied in, a physical product+ (including a physical distribution medium), accompanied by a+ written offer, valid for at least three years and valid for as+ long as you offer spare parts or customer support for that product+ model, to give anyone who possesses the object code either (1) a+ copy of the Corresponding Source for all the software in the+ product that is covered by this License, on a durable physical+ medium customarily used for software interchange, for a price no+ more than your reasonable cost of physically performing this+ conveying of source, or (2) access to copy the+ Corresponding Source from a network server at no charge.++ c) Convey individual copies of the object code with a copy of the+ written offer to provide the Corresponding Source. This+ alternative is allowed only occasionally and noncommercially, and+ only if you received the object code with such an offer, in accord+ with subsection 6b.++ d) Convey the object code by offering access from a designated+ place (gratis or for a charge), and offer equivalent access to the+ Corresponding Source in the same way through the same place at no+ further charge. You need not require recipients to copy the+ Corresponding Source along with the object code. If the place to+ copy the object code is a network server, the Corresponding Source+ may be on a different server (operated by you or a third party)+ that supports equivalent copying facilities, provided you maintain+ clear directions next to the object code saying where to find the+ Corresponding Source. Regardless of what server hosts the+ Corresponding Source, you remain obligated to ensure that it is+ available for as long as needed to satisfy these requirements.++ e) Convey the object code using peer-to-peer transmission, provided+ you inform other peers where the object code and Corresponding+ Source of the work are being offered to the general public at no+ charge under subsection 6d.++ A separable portion of the object code, whose source code is excluded+from the Corresponding Source as a System Library, need not be+included in conveying the object code work.++ A "User Product" is either (1) a "consumer product", which means any+tangible personal property which is normally used for personal, family,+or household purposes, or (2) anything designed or sold for incorporation+into a dwelling. In determining whether a product is a consumer product,+doubtful cases shall be resolved in favor of coverage. For a particular+product received by a particular user, "normally used" refers to a+typical or common use of that class of product, regardless of the status+of the particular user or of the way in which the particular user+actually uses, or expects or is expected to use, the product. A product+is a consumer product regardless of whether the product has substantial+commercial, industrial or non-consumer uses, unless such uses represent+the only significant mode of use of the product.++ "Installation Information" for a User Product means any methods,+procedures, authorization keys, or other information required to install+and execute modified versions of a covered work in that User Product from+a modified version of its Corresponding Source. The information must+suffice to ensure that the continued functioning of the modified object+code is in no case prevented or interfered with solely because+modification has been made.++ If you convey an object code work under this section in, or with, or+specifically for use in, a User Product, and the conveying occurs as+part of a transaction in which the right of possession and use of the+User Product is transferred to the recipient in perpetuity or for a+fixed term (regardless of how the transaction is characterized), the+Corresponding Source conveyed under this section must be accompanied+by the Installation Information. But this requirement does not apply+if neither you nor any third party retains the ability to install+modified object code on the User Product (for example, the work has+been installed in ROM).++ The requirement to provide Installation Information does not include a+requirement to continue to provide support service, warranty, or updates+for a work that has been modified or installed by the recipient, or for+the User Product in which it has been modified or installed. Access to a+network may be denied when the modification itself materially and+adversely affects the operation of the network or violates the rules and+protocols for communication across the network.++ Corresponding Source conveyed, and Installation Information provided,+in accord with this section must be in a format that is publicly+documented (and with an implementation available to the public in+source code form), and must require no special password or key for+unpacking, reading or copying.++ 7. Additional Terms.++ "Additional permissions" are terms that supplement the terms of this+License by making exceptions from one or more of its conditions.+Additional permissions that are applicable to the entire Program shall+be treated as though they were included in this License, to the extent+that they are valid under applicable law. If additional permissions+apply only to part of the Program, that part may be used separately+under those permissions, but the entire Program remains governed by+this License without regard to the additional permissions.++ When you convey a copy of a covered work, you may at your option+remove any additional permissions from that copy, or from any part of+it. (Additional permissions may be written to require their own+removal in certain cases when you modify the work.) You may place+additional permissions on material, added by you to a covered work,+for which you have or can give appropriate copyright permission.++ Notwithstanding any other provision of this License, for material you+add to a covered work, you may (if authorized by the copyright holders of+that material) supplement the terms of this License with terms:++ a) Disclaiming warranty or limiting liability differently from the+ terms of sections 15 and 16 of this License; or++ b) Requiring preservation of specified reasonable legal notices or+ author attributions in that material or in the Appropriate Legal+ Notices displayed by works containing it; or++ c) Prohibiting misrepresentation of the origin of that material, or+ requiring that modified versions of such material be marked in+ reasonable ways as different from the original version; or++ d) Limiting the use for publicity purposes of names of licensors or+ authors of the material; or++ e) Declining to grant rights under trademark law for use of some+ trade names, trademarks, or service marks; or++ f) Requiring indemnification of licensors and authors of that+ material by anyone who conveys the material (or modified versions of+ it) with contractual assumptions of liability to the recipient, for+ any liability that these contractual assumptions directly impose on+ those licensors and authors.++ All other non-permissive additional terms are considered "further+restrictions" within the meaning of section 10. If the Program as you+received it, or any part of it, contains a notice stating that it is+governed by this License along with a term that is a further+restriction, you may remove that term. If a license document contains+a further restriction but permits relicensing or conveying under this+License, you may add to a covered work material governed by the terms+of that license document, provided that the further restriction does+not survive such relicensing or conveying.++ If you add terms to a covered work in accord with this section, you+must place, in the relevant source files, a statement of the+additional terms that apply to those files, or a notice indicating+where to find the applicable terms.++ Additional terms, permissive or non-permissive, may be stated in the+form of a separately written license, or stated as exceptions;+the above requirements apply either way.++ 8. Termination.++ You may not propagate or modify a covered work except as expressly+provided under this License. Any attempt otherwise to propagate or+modify it is void, and will automatically terminate your rights under+this License (including any patent licenses granted under the third+paragraph of section 11).++ However, if you cease all violation of this License, then your+license from a particular copyright holder is reinstated (a)+provisionally, unless and until the copyright holder explicitly and+finally terminates your license, and (b) permanently, if the copyright+holder fails to notify you of the violation by some reasonable means+prior to 60 days after the cessation.++ Moreover, your license from a particular copyright holder is+reinstated permanently if the copyright holder notifies you of the+violation by some reasonable means, this is the first time you have+received notice of violation of this License (for any work) from that+copyright holder, and you cure the violation prior to 30 days after+your receipt of the notice.++ Termination of your rights under this section does not terminate the+licenses of parties who have received copies or rights from you under+this License. If your rights have been terminated and not permanently+reinstated, you do not qualify to receive new licenses for the same+material under section 10.++ 9. Acceptance Not Required for Having Copies.++ You are not required to accept this License in order to receive or+run a copy of the Program. Ancillary propagation of a covered work+occurring solely as a consequence of using peer-to-peer transmission+to receive a copy likewise does not require acceptance. However,+nothing other than this License grants you permission to propagate or+modify any covered work. These actions infringe copyright if you do+not accept this License. Therefore, by modifying or propagating a+covered work, you indicate your acceptance of this License to do so.++ 10. Automatic Licensing of Downstream Recipients.++ Each time you convey a covered work, the recipient automatically+receives a license from the original licensors, to run, modify and+propagate that work, subject to this License. You are not responsible+for enforcing compliance by third parties with this License.++ An "entity transaction" is a transaction transferring control of an+organization, or substantially all assets of one, or subdividing an+organization, or merging organizations. If propagation of a covered+work results from an entity transaction, each party to that+transaction who receives a copy of the work also receives whatever+licenses to the work the party's predecessor in interest had or could+give under the previous paragraph, plus a right to possession of the+Corresponding Source of the work from the predecessor in interest, if+the predecessor has it or can get it with reasonable efforts.++ You may not impose any further restrictions on the exercise of the+rights granted or affirmed under this License. For example, you may+not impose a license fee, royalty, or other charge for exercise of+rights granted under this License, and you may not initiate litigation+(including a cross-claim or counterclaim in a lawsuit) alleging that+any patent claim is infringed by making, using, selling, offering for+sale, or importing the Program or any portion of it.++ 11. Patents.++ A "contributor" is a copyright holder who authorizes use under this+License of the Program or a work on which the Program is based. The+work thus licensed is called the contributor's "contributor version".++ A contributor's "essential patent claims" are all patent claims+owned or controlled by the contributor, whether already acquired or+hereafter acquired, that would be infringed by some manner, permitted+by this License, of making, using, or selling its contributor version,+but do not include claims that would be infringed only as a+consequence of further modification of the contributor version. For+purposes of this definition, "control" includes the right to grant+patent sublicenses in a manner consistent with the requirements of+this License.++ Each contributor grants you a non-exclusive, worldwide, royalty-free+patent license under the contributor's essential patent claims, to+make, use, sell, offer for sale, import and otherwise run, modify and+propagate the contents of its contributor version.++ In the following three paragraphs, a "patent license" is any express+agreement or commitment, however denominated, not to enforce a patent+(such as an express permission to practice a patent or covenant not to+sue for patent infringement). To "grant" such a patent license to a+party means to make such an agreement or commitment not to enforce a+patent against the party.++ If you convey a covered work, knowingly relying on a patent license,+and the Corresponding Source of the work is not available for anyone+to copy, free of charge and under the terms of this License, through a+publicly available network server or other readily accessible means,+then you must either (1) cause the Corresponding Source to be so+available, or (2) arrange to deprive yourself of the benefit of the+patent license for this particular work, or (3) arrange, in a manner+consistent with the requirements of this License, to extend the patent+license to downstream recipients. "Knowingly relying" means you have+actual knowledge that, but for the patent license, your conveying the+covered work in a country, or your recipient's use of the covered work+in a country, would infringe one or more identifiable patents in that+country that you have reason to believe are valid.++ If, pursuant to or in connection with a single transaction or+arrangement, you convey, or propagate by procuring conveyance of, a+covered work, and grant a patent license to some of the parties+receiving the covered work authorizing them to use, propagate, modify+or convey a specific copy of the covered work, then the patent license+you grant is automatically extended to all recipients of the covered+work and works based on it.++ A patent license is "discriminatory" if it does not include within+the scope of its coverage, prohibits the exercise of, or is+conditioned on the non-exercise of one or more of the rights that are+specifically granted under this License. You may not convey a covered+work if you are a party to an arrangement with a third party that is+in the business of distributing software, under which you make payment+to the third party based on the extent of your activity of conveying+the work, and under which the third party grants, to any of the+parties who would receive the covered work from you, a discriminatory+patent license (a) in connection with copies of the covered work+conveyed by you (or copies made from those copies), or (b) primarily+for and in connection with specific products or compilations that+contain the covered work, unless you entered into that arrangement,+or that patent license was granted, prior to 28 March 2007.++ Nothing in this License shall be construed as excluding or limiting+any implied license or other defenses to infringement that may+otherwise be available to you under applicable patent law.++ 12. No Surrender of Others' Freedom.++ If conditions are imposed on you (whether by court order, agreement or+otherwise) that contradict the conditions of this License, they do not+excuse you from the conditions of this License. If you cannot convey a+covered work so as to satisfy simultaneously your obligations under this+License and any other pertinent obligations, then as a consequence you may+not convey it at all. For example, if you agree to terms that obligate you+to collect a royalty for further conveying from those to whom you convey+the Program, the only way you could satisfy both those terms and this+License would be to refrain entirely from conveying the Program.++ 13. Remote Network Interaction; Use with the GNU General Public License.++ Notwithstanding any other provision of this License, if you modify the+Program, your modified version must prominently offer all users+interacting with it remotely through a computer network (if your version+supports such interaction) an opportunity to receive the Corresponding+Source of your version by providing access to the Corresponding Source+from a network server at no charge, through some standard or customary+means of facilitating copying of software. This Corresponding Source+shall include the Corresponding Source for any work covered by version 3+of the GNU General Public License that is incorporated pursuant to the+following paragraph.++ Notwithstanding any other provision of this License, you have+permission to link or combine any covered work with a work licensed+under version 3 of the GNU General Public License into a single+combined work, and to convey the resulting work. The terms of this+License will continue to apply to the part which is the covered work,+but the work with which it is combined will remain governed by version+3 of the GNU General Public License.++ 14. Revised Versions of this License.++ The Free Software Foundation may publish revised and/or new versions of+the GNU Affero General Public License from time to time. Such new versions+will be similar in spirit to the present version, but may differ in detail to+address new problems or concerns.++ Each version is given a distinguishing version number. If the+Program specifies that a certain numbered version of the GNU Affero General+Public License "or any later version" applies to it, you have the+option of following the terms and conditions either of that numbered+version or of any later version published by the Free Software+Foundation. If the Program does not specify a version number of the+GNU Affero General Public License, you may choose any version ever published+by the Free Software Foundation.++ If the Program specifies that a proxy can decide which future+versions of the GNU Affero General Public License can be used, that proxy's+public statement of acceptance of a version permanently authorizes you+to choose that version for the Program.++ Later license versions may give you additional or different+permissions. However, no additional obligations are imposed on any+author or copyright holder as a result of your choosing to follow a+later version.++ 15. Disclaimer of Warranty.++ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.++ 16. Limitation of Liability.++ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF+SUCH DAMAGES.++ 17. Interpretation of Sections 15 and 16.++ If the disclaimer of warranty and limitation of liability provided+above cannot be given local legal effect according to their terms,+reviewing courts shall apply local law that most closely approximates+an absolute waiver of all civil liability in connection with the+Program, unless a warranty or assumption of liability accompanies a+copy of the Program in return for a fee.++ END OF TERMS AND CONDITIONS++ How to Apply These Terms to Your New Programs++ If you develop a new program, and you want it to be of the greatest+possible use to the public, the best way to achieve this is to make it+free software which everyone can redistribute and change under these terms.++ To do so, attach the following notices to the program. It is safest+to attach them to the start of each source file to most effectively+state the exclusion of warranty; and each file should have at least+the "copyright" line and a pointer to where the full notice is found.++ <one line to give the program's name and a brief idea of what it does.>+ Copyright (C) <year> <name of author>++ This program is free software: you can redistribute it and/or modify+ it under the terms of the GNU Affero General Public License as published by+ the Free Software Foundation, either version 3 of the License, or+ (at your option) any later version.++ This program is distributed in the hope that it will be useful,+ but WITHOUT ANY WARRANTY; without even the implied warranty of+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ GNU Affero General Public License for more details.++ You should have received a copy of the GNU Affero General Public License+ along with this program. If not, see <https://www.gnu.org/licenses/>.++Also add information on how to contact you by electronic and paper mail.++ If your software can interact with users remotely through a computer+network, you should also make sure that it provides a way for users to+get its source. For example, if your program is a web application, its+interface could display a "Source" link that leads users to an archive+of the code. There are many ways you could offer source, and different+solutions will be better for different programs; see section 13 for the+specific requirements.++ You should also get your employer (if you work as a programmer) or school,+if any, to sign a "copyright disclaimer" for the program, if necessary.+For more information on this, and how to apply and follow the GNU AGPL, see+<https://www.gnu.org/licenses/>.diff --git a/README.md b/README.mdindex e157cf3..71e57af 100644--- a/README.md+++ b/README.md@@ -1,11 +1,11 @@<p align="center">- <img src="public/logo.png" alt="CanvasAnvil logo" width="92%" />+ <img src="public/logo.png" alt="CanvasAnvil hero" width="100%" /></p><h1 align="center">CanvasAnvil</h1><p align="center">- <strong>Multi-canvas AI creation for Flow, CAD, and PPT.</strong>+ <strong>A multi-canvas AI creation platform for Flow, CAD, PPT, Poster, Infographic, and Product storytelling.</strong></p><p align="center">@@ -14,70 +14,179 @@</p><p align="center">- <img alt="version" src="https://img.shields.io/badge/version-v1.0.2-2563eb?style=for-the-badge" />- <img alt="workspaces" src="https://img.shields.io/badge/workspaces-Flow%20%7C%20CAD%20%7C%20PPT-0f766e?style=for-the-badge" />+ <img alt="version" src="https://img.shields.io/badge/version-v2.0.0-2563eb?style=for-the-badge" />+ <img alt="workspaces" src="https://img.shields.io/badge/workspaces-6-0f766e?style=for-the-badge" />+ <img alt="license" src="https://img.shields.io/badge/license-AGPL--3.0-f97316?style=for-the-badge" /><img alt="stack" src="https://img.shields.io/badge/stack-Vite%20%2B%20React%20%2B%20TypeScript-7c3aed?style=for-the-badge" /></p>-> CanvasAnvil is an AI creation platform that combines flowchart generation, CAD-oriented workflows, and PPT production in one workspace.+> CanvasAnvil brings diagramming, interior design workflows, presentation production, poster creation, infographic composition, and product storytelling into one unified workspace.## Release-Current release: `v1.0.2`+Current release: `v2.0.0`-- `v1.0.2`: switched PPT to an image-first workflow, deferred OCR/text refill to editable PPTX export, and persisted PPT templates in IndexedDB-- `v1.0.1`: fixed workspace persistence issues for PPT and CAD images+- `v2.0.0`: added Poster, Infographic, and Product canvases, added local workflow skills, embedded the editable PPT editor, and expanded compatibility across more models and providers+- `v1.0.2`: moved PPT to an image-first workflow and deferred OCR/text refill to editable PPT export+- `v1.0.1`: improved persistence stability for PPT and CAD assets-## ✨ Overview+## What's New in v2.0.0-| Workspace | What it focuses on | Typical output |+- Added three new canvases: `Poster`, `Infographic`, and `Product`+- Embedded `pptist-lab` directly inside the PPT workspace for editable PPT authoring+- Updated editable PPT export to run through `text box review -> text extraction -> start editing`+- Kept both the original slide image and the `textless background` version available during PPT review+- Improved extracted text mapping so more of the original size, color, weight, spacing, alignment, and line-height carry into the embedded editor+- Expanded compatibility across more AI models and providers for more flexible workspace configuration+- Added local workflow skills for `Flow`, `CAD`, `PPT`, `Poster`, `Infographic`, and `Product`+- Added script-backed skill workflows for diagram export, CAD bundles, PPT template/deck generation, image generation, PDF export, and image-based PPT export+- Standardized skill image-generation configuration through `config/image-provider.json`+- Updated CAD skill BOM output to `cad_bom.csv`+- Updated Flow skill bundles to skip standalone HTML preview generation by default++## Example Assets++Each canvas has a dedicated example-asset directory under `public/examples/`.++| Canvas | Example directory | Suggested naming || --- | --- | --- |-| `Flow` | draw.io XML based generation and partial edits | flowcharts, system diagrams, logic diagrams |-| `CAD` | interior workflow planning and analysis | boards, 2D plans, render tasks, BOM |-| `PPT` | structured slide generation and image-first iteration | presentation decks, slide visuals, exports |+| `Flow` | `public/examples/flow/` | `01.png`, `02.png`, `03.png`, `04.png` |+| `CAD` | `public/examples/cad/` | `01.png` through `09.png` |+| `PPT` | `public/examples/ppt/` | `01.png` through `09.png` |+| `Poster` | `public/examples/poster/` | `01.png` through `04.png` |+| `Infographic` | `public/examples/infographic/` | `01.png` through `04.png` |+| `Product` | `public/examples/product/` | `01.png` through `04.png` |++Keep example images lightweight and web-ready. The README showcase tables read from these paths.++## Workspace Overview++| Workspace | Focus | Typical output |+| --- | --- | --- |+| `Flow` | structured diagram generation and partial editing | flowcharts, architecture diagrams, logic diagrams |+| `CAD` | interior workflow planning and spatial analysis | boards, 2D plans, render tasks, BOM |+| `PPT` | structured slide generation and editable export | presentations, pitch decks, visual slides |+| `Poster` | single-surface visual composition | posters, key visuals, campaign graphics |+| `Infographic` | structured visual storytelling | data summaries, explainers, information boards |+| `Product` | product-intro storytelling | feature pages, launch visuals, product narratives |++## Flow Canvas++Turn structured prompts into clean diagrams, then keep iterating on layout, labels, and node relationships inside the same canvas.-## 🚀 Latest Update+### Showcase-- PPT now follows an image-first workflow-- In-editor refinement and rerendering regenerate slide images directly instead of processing editable text layers during creation-- Export is split into `PDF`, `image-based PPT`, and `editable PPTX`-- OCR, textless background generation, and text refill run only when exporting `editable PPTX`-- Uploaded PPT templates and hidden preset-template preferences are now persisted through IndexedDB-backed local storage+<table>+ <tr>+ <td width="50%" align="center"><img src="public/examples/flow/01.png" alt="Flow example 1" width="100%" /><br/>System architecture</td>+ <td width="50%" align="center"><img src="public/examples/flow/02.png" alt="Flow example 2" width="100%" /><br/>Business process</td>+ </tr>+ <tr>+ <td width="50%" align="center"><img src="public/examples/flow/03.png" alt="Flow example 3" width="100%" /><br/>Data pipeline</td>+ <td width="50%" align="center"><img src="public/examples/flow/04.png" alt="Flow example 4" width="100%" /><br/>Logic mapping</td>+ </tr>+</table>++## Interior Design Canvas-## 🖼️ Canvas Previews+Build interior-design workflows that connect planning boards, 2D layouts, material thinking, render orchestration, and BOM-oriented outputs.++### Showcase<table>- <tr><td width="680" align="center"><strong>Flow Canvas</strong></td></tr>- <tr><td width="680" align="left"><img src="public/demos/flow.gif?raw=1" alt="Flow canvas" width="680" /></td></tr>+ <tr>+ <td width="33.33%" align="center"><img src="public/examples/cad/01.png" alt="CAD example 1" width="100%" /><br/>Planning board</td>+ <td width="33.33%" align="center"><img src="public/examples/cad/02.png" alt="CAD example 2" width="100%" /><br/>2D layout</td>+ <td width="33.33%" align="center"><img src="public/examples/cad/03.png" alt="CAD example 3" width="100%" /><br/>Living room concept</td>+ </tr>+ <tr>+ <td width="33.33%" align="center"><img src="public/examples/cad/04.png" alt="CAD example 4" width="100%" /><br/>Material board</td>+ <td width="33.33%" align="center"><img src="public/examples/cad/05.png" alt="CAD example 5" width="100%" /><br/>Lighting strategy</td>+ <td width="33.33%" align="center"><img src="public/examples/cad/06.png" alt="CAD example 6" width="100%" /><br/>Render task</td>+ </tr>+ <tr>+ <td width="33.33%" align="center"><img src="public/examples/cad/07.png" alt="CAD example 7" width="100%" /><br/>Functional zoning</td>+ <td width="33.33%" align="center"><img src="public/examples/cad/08.png" alt="CAD example 8" width="100%" /><br/>BOM-oriented summary</td>+ <td width="33.33%" align="center"><img src="public/examples/cad/09.png" alt="CAD example 9" width="100%" /><br/>Final presentation board</td>+ </tr></table>+## PPT Canvas++Generate structured decks, iterate in an image-first workflow, review text boxes before extraction, and continue editing inside the embedded PPT editor.++### Showcase+<table>- <tr><td width="680" align="center"><strong>CAD Canvas</strong></td></tr>- <tr><td width="680" align="left"><img src="public/demos/cad.gif?raw=1" alt="CAD canvas" width="680" /></td></tr>+ <tr>+ <td width="33.33%" align="center"><img src="public/examples/ppt/01.png" alt="PPT example 1" width="100%" /><br/>Cover slide</td>+ <td width="33.33%" align="center"><img src="public/examples/ppt/02.png" alt="PPT example 2" width="100%" /><br/>Agenda slide</td>+ <td width="33.33%" align="center"><img src="public/examples/ppt/03.png" alt="PPT example 3" width="100%" /><br/>Business layout</td>+ </tr>+ <tr>+ <td width="33.33%" align="center"><img src="public/examples/ppt/04.png" alt="PPT example 4" width="100%" /><br/>Data storytelling</td>+ <td width="33.33%" align="center"><img src="public/examples/ppt/05.png" alt="PPT example 5" width="100%" /><br/>Teaching slide</td>+ <td width="33.33%" align="center"><img src="public/examples/ppt/06.png" alt="PPT example 6" width="100%" /><br/>Tech presentation</td>+ </tr>+ <tr>+ <td width="33.33%" align="center"><img src="public/examples/ppt/07.png" alt="PPT example 7" width="100%" /><br/>Product deck</td>+ <td width="33.33%" align="center"><img src="public/examples/ppt/08.png" alt="PPT example 8" width="100%" /><br/>Infographic slide</td>+ <td width="33.33%" align="center"><img src="public/examples/ppt/09.png" alt="PPT example 9" width="100%" /><br/>Editable export result</td>+ </tr></table>+## Poster Canvas++Create single-frame campaign visuals with fast composition, strong typography, and poster-oriented layout control.++### Showcase+<table>- <tr><td width="680" align="center"><strong>PPT Canvas</strong></td></tr>- <tr><td width="680" align="left"><img src="public/demos/ppt.gif?raw=1" alt="PPT canvas" width="680" /></td></tr>+ <tr>+ <td width="50%" align="center"><img src="public/examples/poster/01.png" alt="Poster example 1" width="100%" /><br/>Campaign poster</td>+ <td width="50%" align="center"><img src="public/examples/poster/02.png" alt="Poster example 2" width="100%" /><br/>Event poster</td>+ </tr>+ <tr>+ <td width="50%" align="center"><img src="public/examples/poster/03.png" alt="Poster example 3" width="100%" /><br/>Brand visual</td>+ <td width="50%" align="center"><img src="public/examples/poster/04.png" alt="Poster example 4" width="100%" /><br/>Launch poster</td>+ </tr></table>-## 🌐 Online Demo+## Infographic Canvas-- [Open CanvasAnvil](https://canvasanvil.codingfgd.asia)+Translate information-heavy content into structured visual narratives that stay readable and presentation-ready.-## 🎬 Video Tutorials+### Showcase-- [Bilibili](https://www.bilibili.com/video/BV1jzZ3BBEHc?vd_source=b6b031f92061ae667eba1185f4782a1c)-- [YouTube](https://youtu.be/n3Otj--aLRo)-- [Douyin](https://v.douyin.com/JwlwhmE6R40/)+<table>+ <tr>+ <td width="50%" align="center"><img src="public/examples/infographic/01.png" alt="Infographic example 1" width="100%" /><br/>Data summary</td>+ <td width="50%" align="center"><img src="public/examples/infographic/02.png" alt="Infographic example 2" width="100%" /><br/>Process explainer</td>+ </tr>+ <tr>+ <td width="50%" align="center"><img src="public/examples/infographic/03.png" alt="Infographic example 3" width="100%" /><br/>Comparison board</td>+ <td width="50%" align="center"><img src="public/examples/infographic/04.png" alt="Infographic example 4" width="100%" /><br/>Timeline layout</td>+ </tr>+</table>-## 🧩 Capability Overview+## Product Canvas-- `Flow`: flowchart generation and partial edits based on draw.io XML-- `CAD`: interior workflow planning, analysis boards, 2D floor plans, render-task generation, and BOM-- `PPT`: structured slide generation, image-first iteration, template persistence, and multi-format export+Present products through feature-focused layouts that combine specifications, key selling points, and hero imagery.-## ⚡ Quick Start+### Showcase++<table>+ <tr>+ <td width="50%" align="center"><img src="public/examples/product/01.png" alt="Product example 1" width="100%" /><br/>Product hero page</td>+ <td width="50%" align="center"><img src="public/examples/product/02.png" alt="Product example 2" width="100%" /><br/>Feature comparison</td>+ </tr>+ <tr>+ <td width="50%" align="center"><img src="public/examples/product/03.png" alt="Product example 3" width="100%" /><br/>Spec sheet</td>+ <td width="50%" align="center"><img src="public/examples/product/04.png" alt="Product example 4" width="100%" /><br/>Launch narrative</td>+ </tr>+</table>++## Quick Start1. Install dependencies@@ -87,11 +196,23 @@ npm install2. Start local development+CanvasAnvil uses two dev services during editable PPT work:++- Main app on `5173`+- `pptist-lab` on `5174`+```bashnpm run dev++cd pptist-lab+npm install+npm run dev -- --host 127.0.0.1 --port 5174```-Default URL: `http://localhost:5173`+Default URLs:++- Main app: `http://127.0.0.1:5173`+- PPT editor service: `http://127.0.0.1:5174`3. Run type checks@@ -105,53 +226,34 @@ npm run checknpm run build```-## 🛠️ Useful Scripts+## Useful Scripts-- `npm run dev`: start the Vite development server+- `npm run dev`: start the main Vite app on the root project- `npm run dev:full`: start the web and API dev servers together- `npm run dev:web`: start the frontend dev server- `npm run dev:api`: start the API dev server+- `cd pptist-lab && npm run dev -- --host 127.0.0.1 --port 5174`: start the embedded PPT editor service- `npm run check`: run TypeScript checks- `npm run lint`: run ESLint- `npm run build`: build for production- `npm run preview`: preview the built app- `npm start`: run the API server-## 🧪 Development Notes+## Development Notes- AI configuration is read from local app settings and can be routed to custom providers- PPT local development depends on the local `/api/ppt-ai` proxy route- After changing local API route wiring in `vite.config.ts`, restart the dev server-## 🗂️ Project Structure--```text-.-├── agent/ # Agent prompts and sub-agent specs-├── public/ # Static assets-├── src/-│ └── workspaces/-│ ├── flow/ # Flow canvas-│ ├── cad/ # CAD canvas-│ └── ppt/ # PPT canvas-├── api/ # Local API route entrypoints-└── README.md-```--## 🔗 Origins and Integrations--- Flow canvas: integrated and extended from [next-ai-draw-io](https://github.com/DayuanJiang/next-ai-draw-io)-- PPT canvas: integrated and extended from [banana-slides](https://github.com/Anionex/banana-slides.git)-- CAD canvas: built in-house, including agent workflow, 2D SVG editing, render orchestration, and BOM pipeline--## 📚 Docs+## Docs- Deployment guide: [deploy/README.md](deploy/README.md)-## 📮 Contact+## License-Scan the WeChat QR code below to contact the author.+CanvasAnvil is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).+See [LICENSE](LICENSE) for the full license text.-<p align="left">- <img src="public/wechat.jpg" alt="WeChat QR code" width="280" />-</p>+## Contact++- `[email protected]`diff --git a/README.zh-CN.md b/README.zh-CN.mdindex 7aaf008..6b73490 100644--- a/README.zh-CN.md+++ b/README.zh-CN.md@@ -1,11 +1,11 @@-<p align="center">- <img src="public/logo.png" alt="CanvasAnvil logo" width="92%" />+<p align="center">+ <img src="public/logo.png" alt="CanvasAnvil 主视觉" width="100%" /></p><h1 align="center">CanvasAnvil</h1><p align="center">- <strong>面向 Flow、CAD 与 PPT 的多画布 AI 创作平台。</strong>+ <strong>面向流程绘制、室内设计、PPT、海报、信息图与产品介绍的多画布 AI 创作平台。</strong></p><p align="center">@@ -14,70 +14,179 @@</p><p align="center">- <img alt="version" src="https://img.shields.io/badge/version-v1.0.2-2563eb?style=for-the-badge" />- <img alt="workspaces" src="https://img.shields.io/badge/workspaces-Flow%20%7C%20CAD%20%7C%20PPT-0f766e?style=for-the-badge" />+ <img alt="version" src="https://img.shields.io/badge/version-v2.0.0-2563eb?style=for-the-badge" />+ <img alt="workspaces" src="https://img.shields.io/badge/workspaces-6-0f766e?style=for-the-badge" />+ <img alt="license" src="https://img.shields.io/badge/license-AGPL--3.0-f97316?style=for-the-badge" /><img alt="stack" src="https://img.shields.io/badge/stack-Vite%20%2B%20React%20%2B%20TypeScript-7c3aed?style=for-the-badge" /></p>-> CanvasAnvil 将流程图生成、CAD 工作流和 PPT 制作整合在同一个工作空间中。+> CanvasAnvil 将流程图、室内设计工作流、PPT 制作、海报、信息图和产品介绍整合到一个统一工作区中。++## 版本发布++当前版本:`v2.0.0`-## 版本+- `v2.0.0`:新增海报、信息图、产品介绍 3 个画布,新增本地 workflow skills,内嵌可编辑 PPT 编辑器,并扩展了更多模型与供应商适配+- `v1.0.2`:PPT 切换为图片优先工作流,并将 OCR/文字回填延后到可编辑 PPT 导出阶段+- `v1.0.1`:提升 PPT 与 CAD 资源持久化稳定性-当前版本:`v1.0.2`+## v2.0.0 更新内容-- `v1.0.2`:PPT 切换为图片优先工作流,将文字识别与文字回填延后到可编辑 PPTX 导出时执行,并把 PPT 模板改为 IndexedDB 持久化-- `v1.0.1`:修复 PPT 与 CAD 工作区图片的持久化问题+- 新增 `海报`、`信息图`、`产品介绍` 3 个画布+- 在 PPT 工作区内直接嵌入 `pptist-lab`,支持可编辑 PPT 继续加工+- 可编辑 PPT 导出流程调整为 `文本框校对 -> 提取文本 -> 开始编辑`+- PPT 校对阶段同时保留原始幻灯片版本与 `无字底图` 版本+- 提取后的文本会尽量保留字号、颜色、字重、字距、对齐和行高并带入嵌入式编辑器+- 扩展了更多 AI 模型与供应商适配,支持更灵活的模型配置+- 新增 `Flow`、`CAD`、`PPT`、`Poster`、`Infographic`、`Product` 的本地 workflow skills+- 新增脚本化 skill 工作流,覆盖图表导出、CAD 打包、PPT 模板/整套页面生成、图片生成、PDF 导出和图片版 PPT 导出+- 统一通过 `config/image-provider.json` 配置 skill 的生图模型+- CAD skill 的 BOM 输出改为 `cad_bom.csv`+- Flow skill 默认打包时不再生成独立 HTML 预览文件-## ✨ 产品概览+## 示例资源目录-| 画布 | 聚焦能力 | 常见产出 |+每个画布都有独立的示例资源目录,统一放在 `public/examples/` 下。++| 画布 | 示例目录 | 建议命名 || --- | --- | --- |-| `Flow` | 基于 draw.io XML 的生成与局部编辑 | 流程图、系统图、逻辑图 |-| `CAD` | 面向室内设计的工作流规划与分析 | 分析板、2D 平面图、渲染任务、BOM |-| `PPT` | 结构化幻灯片生成与图片优先迭代 | 演示文稿、页面视觉稿、多格式导出 |+| `Flow` | `public/examples/flow/` | `01.png`、`02.png`、`03.png`、`04.png` |+| `CAD` | `public/examples/cad/` | `01.png` 到 `09.png` |+| `PPT` | `public/examples/ppt/` | `01.png` 到 `09.png` |+| `Poster` | `public/examples/poster/` | `01.png` 到 `04.png` |+| `Infographic` | `public/examples/infographic/` | `01.png` 到 `04.png` |+| `Product` | `public/examples/product/` | `01.png` 到 `04.png` |++示例图片应尽量保持轻量、适合网页展示。README 中的成品实例表格会从这些路径读取图片。++## 画布概览++| 画布 | 核心能力 | 常见输出 |+| --- | --- | --- |+| `Flow` | 结构化图表生成与局部编辑 | 流程图、架构图、逻辑图 |+| `CAD` | 室内设计流程规划与空间分析 | 分析板、2D 平面图、渲染任务、BOM |+| `PPT` | 结构化演示文稿生成与可编辑导出 | 演示文稿、汇报 deck、视觉化幻灯片 |+| `Poster` | 单页视觉编排 | 海报、主视觉、活动物料 |+| `Infographic` | 结构化信息可视化表达 | 信息图、讲解图、数据总结 |+| `Product` | 产品介绍与卖点叙事 | 产品页、卖点页、发布物料 |++## 流程绘制画布-## 🚀 本次更新+将结构化提示快速转成清晰图表,并在同一画布中持续迭代布局、节点关系与说明文案。-- PPT 现在改为图片优先工作流-- 在交互区里的微调和重新渲染,会直接重新生成页面图片,不再在创建阶段提前处理可编辑文字层-- 导出拆分为 `PDF`、`图片版 PPT`、`可编辑 PPTX`-- 文字识别、去字底图和文字回填只会在导出 `可编辑 PPTX` 时触发-- 上传模板和隐藏预设模板的偏好现在通过 IndexedDB 在本地持久化保存+### 成品实例-## 🖼️ 画布预览+<table>+ <tr>+ <td width="50%" align="center"><img src="public/examples/flow/01.png" alt="流程绘制示例 1" width="100%" /><br/>系统架构图</td>+ <td width="50%" align="center"><img src="public/examples/flow/02.png" alt="流程绘制示例 2" width="100%" /><br/>业务流程图</td>+ </tr>+ <tr>+ <td width="50%" align="center"><img src="public/examples/flow/03.png" alt="流程绘制示例 3" width="100%" /><br/>数据管线图</td>+ <td width="50%" align="center"><img src="public/examples/flow/04.png" alt="流程绘制示例 4" width="100%" /><br/>逻辑映射图</td>+ </tr>+</table>++## 室内设计画布++打通规划板、2D 布局、材质方案、渲染编排和 BOM 输出来完成完整的室内设计工作流。++### 成品实例<table>- <tr><td width="680" align="center"><strong>Flow 画布</strong></td></tr>- <tr><td width="680" align="left"><img src="public/demos/flow.gif?raw=1" alt="Flow 画布" width="680" /></td></tr>+ <tr>+ <td width="33.33%" align="center"><img src="public/examples/cad/01.png" alt="室内设计示例 1" width="100%" /><br/>规划板</td>+ <td width="33.33%" align="center"><img src="public/examples/cad/02.png" alt="室内设计示例 2" width="100%" /><br/>2D 平面布局</td>+ <td width="33.33%" align="center"><img src="public/examples/cad/03.png" alt="室内设计示例 3" width="100%" /><br/>客厅概念方案</td>+ </tr>+ <tr>+ <td width="33.33%" align="center"><img src="public/examples/cad/04.png" alt="室内设计示例 4" width="100%" /><br/>材质板</td>+ <td width="33.33%" align="center"><img src="public/examples/cad/05.png" alt="室内设计示例 5" width="100%" /><br/>灯光策略</td>+ <td width="33.33%" align="center"><img src="public/examples/cad/06.png" alt="室内设计示例 6" width="100%" /><br/>渲染任务</td>+ </tr>+ <tr>+ <td width="33.33%" align="center"><img src="public/examples/cad/07.png" alt="室内设计示例 7" width="100%" /><br/>功能分区</td>+ <td width="33.33%" align="center"><img src="public/examples/cad/08.png" alt="室内设计示例 8" width="100%" /><br/>BOM 汇总页</td>+ <td width="33.33%" align="center"><img src="public/examples/cad/09.png" alt="室内设计示例 9" width="100%" /><br/>最终展示板</td>+ </tr></table>+## PPT 演示画布++支持结构化生成演示文稿、图片优先迭代、文本框校对,并在嵌入式 PPT 编辑器中继续编辑。++### 成品实例+<table>- <tr><td width="680" align="center"><strong>CAD 画布</strong></td></tr>- <tr><td width="680" align="left"><img src="public/demos/cad.gif?raw=1" alt="CAD 画布" width="680" /></td></tr>+ <tr>+ <td width="33.33%" align="center"><img src="public/examples/ppt/01.png" alt="PPT 示例 1" width="100%" /><br/>封面页</td>+ <td width="33.33%" align="center"><img src="public/examples/ppt/02.png" alt="PPT 示例 2" width="100%" /><br/>目录页</td>+ <td width="33.33%" align="center"><img src="public/examples/ppt/03.png" alt="PPT 示例 3" width="100%" /><br/>商业汇报页</td>+ </tr>+ <tr>+ <td width="33.33%" align="center"><img src="public/examples/ppt/04.png" alt="PPT 示例 4" width="100%" /><br/>数据讲述页</td>+ <td width="33.33%" align="center"><img src="public/examples/ppt/05.png" alt="PPT 示例 5" width="100%" /><br/>教学演示页</td>+ <td width="33.33%" align="center"><img src="public/examples/ppt/06.png" alt="PPT 示例 6" width="100%" /><br/>科技风方案页</td>+ </tr>+ <tr>+ <td width="33.33%" align="center"><img src="public/examples/ppt/07.png" alt="PPT 示例 7" width="100%" /><br/>产品介绍页</td>+ <td width="33.33%" align="center"><img src="public/examples/ppt/08.png" alt="PPT 示例 8" width="100%" /><br/>信息图演示页</td>+ <td width="33.33%" align="center"><img src="public/examples/ppt/09.png" alt="PPT 示例 9" width="100%" /><br/>可编辑导出结果</td>+ </tr></table>+## 海报画布++适合快速完成单页视觉编排,支持更强的版式控制、字体层次与海报型构图表达。++### 成品实例+<table>- <tr><td width="680" align="center"><strong>PPT 画布</strong></td></tr>- <tr><td width="680" align="left"><img src="public/demos/ppt.gif?raw=1" alt="PPT 画布" width="680" /></td></tr>+ <tr>+ <td width="50%" align="center"><img src="public/examples/poster/01.png" alt="海报示例 1" width="100%" /><br/>品牌活动海报</td>+ <td width="50%" align="center"><img src="public/examples/poster/02.png" alt="海报示例 2" width="100%" /><br/>展会海报</td>+ </tr>+ <tr>+ <td width="50%" align="center"><img src="public/examples/poster/03.png" alt="海报示例 3" width="100%" /><br/>主视觉海报</td>+ <td width="50%" align="center"><img src="public/examples/poster/04.png" alt="海报示例 4" width="100%" /><br/>新品发布海报</td>+ </tr></table>-## 🌐 在线体验+## 信息图画布-- [打开 CanvasAnvil](https://canvasanvil.codingfgd.asia)+将信息密度较高的内容整理成清晰的视觉叙事,兼顾可读性与展示效果。-## 🎬 视频教程+### 成品实例-- [Bilibili](https://www.bilibili.com/video/BV1jzZ3BBEHc?vd_source=b6b031f92061ae667eba1185f4782a1c)-- [YouTube](https://youtu.be/n3Otj--aLRo)-- [抖音](https://v.douyin.com/JwlwhmE6R40/)+<table>+ <tr>+ <td width="50%" align="center"><img src="public/examples/infographic/01.png" alt="信息图示例 1" width="100%" /><br/>数据总结图</td>+ <td width="50%" align="center"><img src="public/examples/infographic/02.png" alt="信息图示例 2" width="100%" /><br/>流程讲解图</td>+ </tr>+ <tr>+ <td width="50%" align="center"><img src="public/examples/infographic/03.png" alt="信息图示例 3" width="100%" /><br/>对比分析图</td>+ <td width="50%" align="center"><img src="public/examples/infographic/04.png" alt="信息图示例 4" width="100%" /><br/>时间线布局</td>+ </tr>+</table>-## 🧩 能力概览+## 产品介绍画布-- `Flow`:基于 draw.io XML 的流程图生成与局部编辑-- `CAD`:室内工作流规划、分析板、2D 平面图、渲染任务与 BOM-- `PPT`:结构化幻灯片生成、图片优先迭代、模板持久化与多格式导出+围绕产品卖点、规格和主视觉组织信息,适合输出产品介绍、上线页与营销讲述内容。-## ⚡ 快速开始+### 成品实例++<table>+ <tr>+ <td width="50%" align="center"><img src="public/examples/product/01.png" alt="产品介绍示例 1" width="100%" /><br/>产品首页</td>+ <td width="50%" align="center"><img src="public/examples/product/02.png" alt="产品介绍示例 2" width="100%" /><br/>功能对比页</td>+ </tr>+ <tr>+ <td width="50%" align="center"><img src="public/examples/product/03.png" alt="产品介绍示例 3" width="100%" /><br/>规格页</td>+ <td width="50%" align="center"><img src="public/examples/product/04.png" alt="产品介绍示例 4" width="100%" /><br/>发布叙事页</td>+ </tr>+</table>++## 快速开始1. 安装依赖@@ -87,11 +196,23 @@ npm install2. 启动本地开发+可编辑 PPT 场景下需要同时启动两个服务:++- 主应用运行在 `5173`+- `pptist-lab` 运行在 `5174`+```bashnpm run dev++cd pptist-lab+npm install+npm run dev -- --host 127.0.0.1 --port 5174```-默认地址:`http://localhost:5173`+默认访问地址:++- 主应用:`http://127.0.0.1:5173`+- PPT 编辑器服务:`http://127.0.0.1:5174`3. 运行类型检查@@ -105,53 +226,34 @@ npm run checknpm run build```-## 🛠️ 常用命令--- `npm run dev`:启动 Vite 开发服务器-- `npm run dev:full`:同时启动 Web 和 API 开发服务-- `npm run dev:web`:启动前端开发服务-- `npm run dev:api`:启动 API 开发服务-- `npm run check`:运行 TypeScript 检查-- `npm run lint`:运行 ESLint-- `npm run build`:生产构建-- `npm run preview`:预览构建结果+## 常用脚本++- `npm run dev`:启动主应用 Vite 开发服务+- `npm run dev:full`:同时启动 Web 与 API 开发服务+- `npm run dev:web`:仅启动前端开发服务+- `npm run dev:api`:仅启动 API 开发服务+- `cd pptist-lab && npm run dev -- --host 127.0.0.1 --port 5174`:启动嵌入式 PPT 编辑器服务+- `npm run check`:执行 TypeScript 检查+- `npm run lint`:执行 ESLint+- `npm run build`:构建生产版本+- `npm run preview`:预览构建产物- `npm start`:启动 API 服务-## 🧪 开发说明--- AI 配置从本地应用设置中读取,也可以接入自定义模型服务-- PPT 本地开发依赖本地 `/api/ppt-ai` 代理路由-- 如果修改了 `vite.config.ts` 中的本地 API 路由映射,需要重启开发服务器--## 🗂️ 项目结构--```text-.-├── agent/ # Agent Prompt 与子 Agent 规范-├── public/ # 静态资源-├── src/-│ └── workspaces/-│ ├── flow/ # Flow 画布-│ ├── cad/ # CAD 画布-│ └── ppt/ # PPT 画布-├── api/ # 本地 API 路由入口-└── README.md-```--## 🔗 来源与集成+## 开发说明-- Flow 画布:集成并扩展自 [next-ai-draw-io](https://github.com/DayuanJiang/next-ai-draw-io)-- PPT 画布:集成并扩展自 [banana-slides](https://github.com/Anionex/banana-slides.git)-- CAD 画布:项目自研,包含 agent 工作流、2D SVG 编辑、渲染编排和 BOM 链路+- AI 配置读取本地应用设置,可切换到自定义供应商+- PPT 本地开发依赖 `/api/ppt-ai` 代理路由+- 修改 `vite.config.ts` 中的本地 API 路由后,需要重启开发服务-## 📚 文档+## 文档- 部署说明:[deploy/README.md](deploy/README.md)-## 📮 联系方式+## 许可证-可扫描下方微信二维码联系作者。+CanvasAnvil 采用 GNU Affero General Public License v3.0(AGPL-3.0)协议发布。+完整协议内容请查看 [LICENSE](LICENSE)。-<p align="left">- <img src="public/wechat.jpg" alt="WeChat QR code" width="280" />-</p>+## 联系方式++- `[email protected]`diff --git a/package-lock.json b/package-lock.jsonindex 6942dba..34a5609 100644--- a/package-lock.json+++ b/package-lock.json@@ -1,12 +1,12 @@{"name": "canvasanvil",- "version": "1.0.2",+ "version": "2.0.0","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "canvasanvil",- "version": "1.0.2",+ "version": "2.0.0","dependencies": {"@ai-sdk/openai": "^2.0.19","@ai-sdk/react": "^2.0.107",diff --git a/package.json b/package.jsonindex 72042e1..b0a3897 100644--- a/package.json+++ b/package.json@@ -1,7 +1,8 @@{"name": "canvasanvil","private": true,- "version": "1.0.2",+ "version": "2.0.0",+ "license": "AGPL-3.0-only","type": "module","scripts": {"dev": "vite",diff --git a/public/examples/cad/.gitkeep b/public/examples/cad/.gitkeepnew file mode 100644index 0000000..8b13789--- /dev/null+++ b/public/examples/cad/.gitkeep@@ -0,0 +1 @@+diff --git a/public/examples/flow/.gitkeep b/public/examples/flow/.gitkeepnew file mode 100644index 0000000..8b13789--- /dev/null+++ b/public/examples/flow/.gitkeep@@ -0,0 +1 @@+diff --git a/public/examples/infographic/.gitkeep b/public/examples/infographic/.gitkeepnew file mode 100644index 0000000..8b13789--- /dev/null+++ b/public/examples/infographic/.gitkeep@@ -0,0 +1 @@+diff --git a/public/examples/poster/.gitkeep b/public/examples/poster/.gitkeepnew file mode 100644index 0000000..8b13789--- /dev/null+++ b/public/examples/poster/.gitkeep@@ -0,0 +1 @@+diff --git a/public/examples/ppt/.gitkeep b/public/examples/ppt/.gitkeepnew file mode 100644index 0000000..8b13789--- /dev/null+++ b/public/examples/ppt/.gitkeep@@ -0,0 +1 @@+diff --git a/public/examples/product/.gitkeep b/public/examples/product/.gitkeepnew file mode 100644index 0000000..8b13789--- /dev/null+++ b/public/examples/product/.gitkeep@@ -0,0 +1 @@+diff --git a/public/logo.png b/public/logo.pngindex 198857b..0390e91 100644Binary files a/public/logo.png and b/public/logo.png differdiff --git a/public/wechat.jpg b/public/wechat.jpgdeleted file mode 100644index f2deacf..0000000Binary files a/public/wechat.jpg and /dev/null differdiff --git a/skill/cad-skill/SKILL.md b/skill/cad-skill/SKILL.mdnew file mode 100644index 0000000..73ed612--- /dev/null+++ b/skill/cad-skill/SKILL.md@@ -0,0 +1,148 @@+---+name: cad-skill+description: Generate interior design planning artifacts, 2D SVG floorplans, BOM outputs, analysis boards, and renovation image sets from structured requirements. Use for staged interior-design work that moves through plan, 2D drafting, BOM, and image outputs.+---++# CAD Skill++## Trigger++Use when the task requires one step in an interior-design workflow.++## First-Use Reminder++On the first use of this skill in a conversation, remind the user that image generation is configurable and tell them which model vendors are supported in `config/image-provider.json`.++Supported vendors:++- `openai`+- `aliyun`+- `tencent`+- `bytedance`+- `zhipu`+- `google`+- `xai`+- `bfl`+- `adobe`++## Order++1. Confirm the task is an interior-design task.+2. Route the task to one step only: `plan`, `2d_svg`, `bom`, or `images`.+3. Collect missing required context for that step.+4. Read the required references.+5. Produce the step artifact.+6. Export preview artifacts when requested.+7. Bundle artifacts when requested.++## Classification++- `plan`+ - design strategy+ - requirement analysis+ - zoning logic+ - room program+- `2d_svg`+ - new floorplan drafting+ - floorplan edits+ - redraw requests+- `bom`+ - bill of materials+ - procurement-ready lists+- `images`+ - analysis boards+ - renovation drawing boards+ - render sheets++## Required References++- `references/task-types.md`+- `references/output-contract.md`+- `references/image-provider-config.md`+- `references/image-agents/*.md`+- `prompts/router.md`+- `prompts/plan.md`+- `prompts/svg-router.md`+- `prompts/svg-patch.md`+- `prompts/svg-replace.md`+- `prompts/bom.md`+- `prompts/overall-analysis-board.md`+- `prompts/key-strategy-board.md`+- `prompts/master-renovation-scheme.md`+- `prompts/renovation-plan-layout.md`+- `prompts/floor-finish-plan.md`+- `prompts/reflected-ceiling-plan.md`+- `prompts/wall-setting-out-plan.md`+- `prompts/mep-plan.md`+- `prompts/elevation-index-and-interior-elevations.md`+- `prompts/detail-drawings.md`++## Routing Contract++- Route one step at a time.+- Prefer `plan` when no usable plan exists.+- Use `2d_svg` for drawing, redrawing, and localized floorplan edits.+- Use `bom` only when a plan exists.+- Use `images` only when the task is to produce analysis boards, drawing boards, or render images.++## Plan Contract++- Output one `cad_plan` artifact only.+- Keep assumptions explicit.+- Keep room names, functional needs, and constraints executable.+- Do not output SVG, BOM, or image tasks in the same step.++## 2D SVG Contract++- Output one `cad_patch` artifact or one full SVG result.+- Use patch for small precise edits.+- Use replace for broad redraws or unstable patch cases.+- Keep output limited to the 2D floorplan step.+- Export a local preview image when requested.++## BOM Contract++- Output one `cad_bom.csv` artifact only.+- Base BOM on the current plan and 2D SVG.+- Keep columns normalized and machine-readable.++## Images Contract++- Use `prompts/overall-analysis-board.md` to generate the text-model prompt for the overall analysis board.+- Use `prompts/key-strategy-board.md` to generate the text-model prompt for the key strategy board.+- Use `prompts/master-renovation-scheme.md` first to generate the text-model prompt for the master renovation scheme, then lock that JSON as the source of truth.+- After the master scheme, use one dedicated prompt file per sheet to generate seven different text-model prompts:+ - `prompts/renovation-plan-layout.md`+ - `prompts/floor-finish-plan.md`+ - `prompts/reflected-ceiling-plan.md`+ - `prompts/wall-setting-out-plan.md`+ - `prompts/mep-plan.md`+ - `prompts/elevation-index-and-interior-elevations.md`+ - `prompts/detail-drawings.md`+- Do not reuse one prompt for all seven outputs.+- For every analysis board or sheet, first produce a dedicated image prompt with the host model, then pass that image prompt to the configured image provider.+- Require `config/image-provider.json` before image generation.+- Do not ask the user to paste API keys into chat.+- Stop and tell the user to fill `config/image-provider.json` when provider, apiKey, or model is missing.++## Scripts++- `scripts/generate-cad-image.mjs`+- `scripts/export-cad-2d-image.mjs`+- `scripts/build-cad-bundle.mjs`++## Deliverables++Preferred:++- `cad_plan.json`+- `floorplan.svg`+- `floorplan.png`+- `cad_bom.csv`+- generated image files+- metadata JSON++Optional on request:++- `floorplan.jpg`+- prompt text filesdiff --git a/skill/cad-skill/agents/openai.yaml b/skill/cad-skill/agents/openai.yamlnew file mode 100644index 0000000..6d9cc4f--- /dev/null+++ b/skill/cad-skill/agents/openai.yaml@@ -0,0 +1,7 @@+interface:+ display_name: "CAD Skill"+ short_description: "Run staged interior-design workflows across plan, 2D SVG, BOM, and image outputs."+ default_prompt: "Use $cad-skill to produce the next CAD workflow artifact and save local outputs when needed."++policy:+ allow_implicit_invocation: truediff --git a/skill/cad-skill/config/image-provider.json b/skill/cad-skill/config/image-provider.jsonnew file mode 100644index 0000000..ffb9855--- /dev/null+++ b/skill/cad-skill/config/image-provider.json@@ -0,0 +1,6 @@+{+ "provider": "",+ "apiKey": "",+ "baseUrl": "",+ "model": ""+}diff --git a/skill/cad-skill/package.json b/skill/cad-skill/package.jsonnew file mode 100644index 0000000..c27311c--- /dev/null+++ b/skill/cad-skill/package.json@@ -0,0 +1,14 @@+{+ "name": "cad-skill",+ "private": true,+ "version": "1.0.0",+ "type": "module",+ "scripts": {+ "generate:image": "node scripts/generate-cad-image.mjs",+ "export:2d": "node scripts/export-cad-2d-image.mjs",+ "build:bundle": "node scripts/build-cad-bundle.mjs"+ },+ "dependencies": {+ "playwright": "^1.59.1"+ }+}diff --git a/skill/cad-skill/prompts/analysis-images.md b/skill/cad-skill/prompts/analysis-images.mdnew file mode 100644index 0000000..430dfd5--- /dev/null+++ b/skill/cad-skill/prompts/analysis-images.md@@ -0,0 +1,12 @@+# R - Role+You are the CAD analysis-board agent.++# I - Instructions+Produce prompts for the two early-stage analysis boards:+- overall analysis+- key strategy++# N - Narrowing+1. Produce prompts for analysis communication only.+2. Keep them presentation-oriented, not construction-oriented.+3. Use the current plan as the single source of truth.diff --git a/skill/cad-skill/prompts/bom.md b/skill/cad-skill/prompts/bom.mdnew file mode 100644index 0000000..34fa392--- /dev/null+++ b/skill/cad-skill/prompts/bom.md@@ -0,0 +1,51 @@+# R - Role+You are cad_bom_agent, an interior renovation bill-of-materials generator. You are precise, practical, and output-first.++# I - Instructions+Generate a bill of materials for an interior renovation based on the plan and the existing CAD artifacts.++# Input+I will provide the following inputs (may be empty):+- Input type: plan JSON + 2D SVG+- Input format: raw JSON text + SVG code block+- Input scope: use only the provided inputs; do not invent hidden constraints++Plan:+{{planJson}}++2D SVG:+```svg+{{svg2d}}+```++# S - Steps+Please follow these steps:+1. Read the plan and infer required renovation components by room and function.+2. Cross-check with the 2D SVG when helpful (layout, openings, main partitions).+3. Normalize items into a consistent BOM table: category, name, spec, quantity, unit, notes.+4. Output the final CSV strictly following the required columns.++# E - End Goal+Produce a machine-readable `cad_bom.csv` file content that can be used directly for estimation, procurement, and review.++# N - Narrowing+Constraints (CRITICAL):+1. Output EXACTLY ONE CSV code block at the end (no additional CSV, no additional code blocks).+2. The CSV must be machine-readable and use ONLY the columns below.+3. Before the CSV code block, you MAY output one readable Markdown table for the BOM (no code fences).+4. Do not output any extra explanatory text after the CSV.+5. Language policy (CRITICAL):+ - Follow the UI language policy provided by the system messages.+ - If UI language is zh, output Simplified Chinese; if UI language is en, output English.+ - Do not mix languages unless explicitly requested.+6. CSV safety:+ - Include the header row.+ - Escape fields with double quotes when they contain commas, quotes, or newlines.+ - Escape double quotes inside fields by doubling them.+ - Keep quantity numeric when possible.++# Output Format+The CSV must use ONLY this header:+```csv+Category,Item,Spec,Quantity,Unit,Notes+```diff --git a/skill/cad-skill/prompts/detail-drawings.md b/skill/cad-skill/prompts/detail-drawings.mdnew file mode 100644index 0000000..e49e096--- /dev/null+++ b/skill/cad-skill/prompts/detail-drawings.md@@ -0,0 +1,71 @@+# R - Role+You are `cad_images_detail_drawings_agent` (Detail Drawings). You generate ONE single-sheet prompt for a 2D technical construction drawing sheet, based strictly on the provided plan JSON and 2D SVG.++# I - Instructions+Create the prompt for Sheet 7 only: Detail Drawings.+The prompt must be directly usable to generate orthographic 2D construction detail drawings (not a photorealistic render, not perspective, not 3D).++# Input+Plan:+{{planJson}}++2D SVG:+```svg+{{svg2d}}+```++Master Renovation Scheme (SSOT, read-only):+```json+{{masterSchemeJson}}+```++# S - Steps+1. Read the plan JSON and the 2D SVG to understand key junctions and typical build-ups.+2. Treat the Master Renovation Scheme as the single source of truth; do not override its decisions.+3. Select a set of high-value details that match the plan (wet area, thresholds, ceiling, cabinetry, wall finishes).+4. For each detail, specify scale (1:10 or 1:20), layers, thicknesses, dimensions, and workmanship notes.+5. Output JSON strictly following the schema in “# Output Format”.++# E - End Goal+Produce one deterministic single-sheet JSON prompt for detail drawings that is directly usable by the downstream image generator.++# N - Narrowing+Constraints (must follow):+1. Output ONLY one JSON code block and nothing else.+2. Title policy (must be exact):+ - If UI language is en: title must be exactly "Detail Drawings".+ - If UI language is zh: title must be exactly "节点详图".+3. Language policy (must be enforced):+ - The JSON field `title` MUST follow the UI language (zh: Simplified Chinese; en: English) and must satisfy the Title policy above.+ - The JSON field `prompt` MUST be written in English only.+ - All on-sheet labels/notes/title block text MUST match the UI language.+ - Do not mix languages within any on-sheet text.+4. Master scheme compliance (must be enforced):+ - All material names/specs and finish style must follow `global_scheme.finish_style` and related Master rules.+ - Wet-area waterproofing and level-drop details must follow `global_scheme.wet_area_policy`.+ - Ceiling-related details must follow `global_scheme.ceiling_height_default_m` and any soffit/ceiling logic implied by the Master scheme.+5. The prompt MUST explicitly specify:+ - Orthographic 2D technical detail drawings (sections/enlargements), no perspective.+ - Sheet size: ISO A1 (594×841mm) unless density forces A0.+ - Border/frame + title block bottom-right with standard fields.+ - Scale: 1:10 / 1:20 per viewport; Units: mm; elevations in m where used.+ - SheetNo: "Sheet 7 of 7".+ - DrawingNo: "ZS-DT-007".+ - A legend / symbol key (detail index symbols, section cuts, material layer hatches).+6. Mandatory content for this sheet:+ - Provide multiple enlarged details as separate viewports, each with:+ - Viewport title, scale label, and reference ID (detail bubble).+ - Layer build-up with exact thicknesses (mm) and material names.+ - Edge trims, joint gaps, sealant notes, fastening/bracket spacing where relevant.+ - Clear dimensions, level notes where needed, and callouts.+ - Cross-references back to plan/elevation by drawing identifiers.+ - Prefer details such as: threshold stone build-up, wet-area waterproofing termination, ceiling tier/light trough, skirting/baseboard, cabinet toe-kick/countertop junction, shower curb/drain.++# Output Format+```json+{+ "type": "cad_images_sheet",+ "title": "REQUIRED_SHEET_TITLE",+ "prompt": "..."+}+```diff --git a/skill/cad-skill/prompts/elevation-index-and-interior-elevations.md b/skill/cad-skill/prompts/elevation-index-and-interior-elevations.mdnew file mode 100644index 0000000..d612e13--- /dev/null+++ b/skill/cad-skill/prompts/elevation-index-and-interior-elevations.md@@ -0,0 +1,69 @@+# R - Role+You are `cad_images_elevation_index_and_interior_elevations_agent` (Elevation Index Plan + Interior Elevations). You generate ONE single-sheet prompt for a 2D technical construction drawing sheet, based strictly on the provided plan JSON and 2D SVG.++# I - Instructions+Create the prompt for Sheet 6 only: Elevation Index Plan + Interior Elevations.+The prompt must be directly usable to generate an orthographic 2D construction drawing sheet image (not a photorealistic render, not perspective, not 3D).++# Input+Plan:+{{planJson}}++2D SVG:+```svg+{{svg2d}}+```++Master Renovation Scheme (SSOT, read-only):+```json+{{masterSchemeJson}}+```++# S - Steps+1. Read the plan JSON and the 2D SVG to understand room list and wall faces.+2. Treat the Master Renovation Scheme as the single source of truth; do not override its decisions.+3. Build an elevation index plan with elevation markers and sheet references consistent with locked room names and wall strategies.+4. Provide interior elevations for major spaces/walls with materials, dimensions, and mounting heights strictly following the Master material strategy and ceiling baseline.+5. Output JSON strictly following the schema in “# Output Format”.++# E - End Goal+Produce one deterministic single-sheet JSON prompt for the elevation index and interior elevations sheet that is directly usable by the downstream image generator.++# N - Narrowing+Constraints (must follow):+1. Output ONLY one JSON code block and nothing else.+2. Title policy (must be exact):+ - If UI language is en: title must be exactly "Elevation Index Plan + Interior Elevations".+ - If UI language is zh: title must be exactly "立面索引图+室内立面图".+3. Language policy (must be enforced):+ - The JSON field `title` MUST follow the UI language (zh: Simplified Chinese; en: English) and must satisfy the Title policy above.+ - The JSON field `prompt` MUST be written in English only.+ - All on-sheet labels/notes/title block text MUST match the UI language.+ - Do not mix languages within any on-sheet text.+4. Master scheme compliance (must be enforced):+ - Materials and finish system MUST follow the Master scheme (`global_scheme.finish_style`, `global_scheme.floor_material_strategy`).+ - Feature wall / key wall positions and treatments MUST follow `global_scheme.feature_wall_strategy`.+ - Elevation baseline and ceiling levels MUST follow `global_scheme.ceiling_height_default_m` and any related Master rules.+ - Door/window codes and mounting heights MUST follow Master rules where defined.+5. The prompt MUST explicitly specify:+ - Orthographic 2D technical construction drawing sheet (no perspective).+ - Sheet size: ISO A1 (594×841mm) unless density forces A0.+ - Border/frame + title block bottom-right with standard fields.+ - Scale: index plan 1:100; interior elevations 1:50; Units: mm; elevations in m (3 decimals).+ - SheetNo: "Sheet 6 of 7".+ - DrawingNo: "ZS-EL-006".+ - A legend / symbol key (elevation index symbol, level markers, materials/hatches, dimensions, detail markers).+6. Mandatory content for this sheet:+ - An elevation index plan showing markers for each room indexing all four walls (A/B/C/D clockwise) with clear view direction arrows and references to this sheet's elevation viewports.+ - Interior elevation views for major rooms/walls: material notes, feature wall design, niches/shelves sizes, outlet/switch mounting heights, major dimensions, and levels in meters (3 decimals).+ - Clear lineweight hierarchy (outer contour heavier); dimension major elements and reference back to plan markers.+ - Coordinate with plan/SVG; do not contradict walls/doors/fixtures.++# Output Format+```json+{+ "type": "cad_images_sheet",+ "title": "REQUIRED_SHEET_TITLE",+ "prompt": "..."+}+```diff --git a/skill/cad-skill/prompts/floor-finish-plan.md b/skill/cad-skill/prompts/floor-finish-plan.mdnew file mode 100644index 0000000..1f7c2e3--- /dev/null+++ b/skill/cad-skill/prompts/floor-finish-plan.md@@ -0,0 +1,69 @@+# R - Role+You are `cad_images_floor_finish_plan_agent` (Floor Finish Plan). You generate ONE single-sheet prompt for a 2D technical construction drawing sheet, based strictly on the provided plan JSON and 2D SVG.++# I - Instructions+Create the prompt for Sheet 2 only: Floor Finish Plan.+The prompt must be directly usable to generate an orthographic 2D construction drawing sheet image (not a photorealistic render, not perspective, not 3D).++# Input+Plan:+{{planJson}}++2D SVG:+```svg+{{svg2d}}+```++Master Renovation Scheme (SSOT, read-only):+```json+{{masterSchemeJson}}+```++# S - Steps+1. Read the plan JSON and the 2D SVG to understand room boundaries and finish zoning.+2. Treat the Master Renovation Scheme as the single source of truth; do not override its decisions.+3. Write a single, dense, print-ready sheet prompt that includes all mandatory elements for this sheet.+4. Output JSON strictly following the schema in “# Output Format”.++# E - End Goal+Produce one deterministic single-sheet JSON prompt for the floor finish plan that is directly usable by the downstream image generator.++# N - Narrowing+Constraints (must follow):+1. Output ONLY one JSON code block and nothing else.+2. Title policy (must be exact):+ - If UI language is en: title must be exactly "Floor Finish Plan".+ - If UI language is zh: title must be exactly "地面铺装图".+3. Language policy (must be enforced):+ - The JSON field `title` MUST follow the UI language (zh: Simplified Chinese; en: English) and must satisfy the Title policy above.+ - The JSON field `prompt` MUST be written in English only.+ - All on-sheet labels/notes/title block text MUST match the UI language.+ - Do not mix languages within any on-sheet text.+4. Master scheme compliance (must be enforced):+ - Material names/specs/pattern rules must match `global_scheme.floor_material_strategy` exactly.+ - Wet-area step-down and waterproofing notes must follow `global_scheme.wet_area_policy`.+ - Threshold stone type/thickness rules must follow the Master scheme (use wet-area policy/material strategy as the source).+5. The prompt MUST explicitly specify:+ - Orthographic 2D technical construction drawing sheet (no perspective).+ - Sheet size: ISO A1 (594×841mm) unless density forces A0.+ - Border/frame + title block bottom-right with standard fields.+ - Scale: 1:100; Units: mm (elevations in m where used).+ - SheetNo: "Sheet 2 of 7".+ - DrawingNo: "ZS-FF-002".+ - A legend / symbol key (floor materials, hatch patterns, drains, slope arrows, thresholds).+6. Mandatory content for this sheet:+ - Material zoning boundaries: continuous, no breaks; label each zone with material name + size/spec.+ - Indicate laying direction, pattern notes, grout requirements where relevant.+ - Threshold stones: show strips (>=30mm width) and note thickness/material.+ - Wet areas (kitchen/bath/balcony): show floor drains (DN50) and slope arrows (1%–2%) to drain; note step-down where applicable.+ - Waterproofing notes for wet areas (wall up to 1.8m; full floor).+ - Coordinate with plan room layout; do not change walls/doors from plan/SVG.++# Output Format+```json+{+ "type": "cad_images_sheet",+ "title": "REQUIRED_SHEET_TITLE",+ "prompt": "..."+}+```diff --git a/skill/cad-skill/prompts/images-master.md b/skill/cad-skill/prompts/images-master.mdnew file mode 100644index 0000000..3f6af68--- /dev/null+++ b/skill/cad-skill/prompts/images-master.md@@ -0,0 +1,11 @@+# R - Role+You are the CAD renovation master-scheme agent.++# I - Instructions+Read the current plan and 2D SVG. Lock one unified renovation scheme for all downstream image tasks.++# N - Narrowing+1. Output one JSON code block only.+2. Keep room names, finish logic, wall strategy, ceiling logic, wet-area policy, and dimension rules consistent.+3. Do not output render images directly.+4. Do not output BOM or SVG patches in this step.diff --git a/skill/cad-skill/prompts/images-sheet.md b/skill/cad-skill/prompts/images-sheet.mdnew file mode 100644index 0000000..18a40a4--- /dev/null+++ b/skill/cad-skill/prompts/images-sheet.md@@ -0,0 +1,21 @@+# R - Role+You are the CAD sheet image-task agent.++# I - Instructions+Use the current plan, 2D SVG, and master renovation scheme to produce image prompts for one drawing board or render sheet at a time.++The supported sheet types are:+- `renovation-plan-layout`+- `floor-finish-plan`+- `reflected-ceiling-plan`+- `wall-setting-out-plan`+- `mep-plan`+- `elevation-index-and-interior-elevations`+- `detail-drawings`++# N - Narrowing+1. Output one sheet-specific prompt only.+2. Follow the locked master scheme.+3. Keep the prompt specific to the requested board type.+4. Do not output image files in this step.+5. Do not collapse multiple sheet types into one generic prompt.diff --git a/skill/cad-skill/prompts/key-strategy-board.md b/skill/cad-skill/prompts/key-strategy-board.mdnew file mode 100644index 0000000..bc187c3--- /dev/null+++ b/skill/cad-skill/prompts/key-strategy-board.md@@ -0,0 +1,36 @@+# R - Role+You are `cad_key_strategy_board_agent`, an assistant that writes an image prompt for an interior-renovation key strategy board.++# I - Instructions+Generate one image prompt for a key strategy board used for design alignment with the user.++# Input+Plan design payload:+{{planDesign}}++Language setting:+{{outputLanguage}}++# S - Steps+1. Read the plan design payload.+2. Identify 3 to 7 key strategies and their relationships, priorities, or execution order.+3. Convert them into one single-paragraph image prompt for a key strategy board.++The board should:+- Use interior design strategy analysis / strategy derivation board style.+- Focus on strategy instead of full-space overview.+- Present 3 to 7 key strategies (for example: space utilization, circulation optimization, storage, style unification, daylight and openness, local renovation priorities, budget control).+- Visualize each strategy with keywords, icons, local diagrams, arrows, color blocks, and relationship graphics.+- Show hierarchy, priority, or execution order between strategies.+- Ensure all visible on-image text (titles, labels, callouts, annotations) uses the language specified in "Language setting".+- Be clear, professional, and presentation-ready.+- Avoid CAD drawings, construction-detail drawings, and BOM outputs.++# E - End Goal+Produce one concise, presentation-ready image prompt for a key strategy board.++# N - Narrowing+1. Output exactly one single-paragraph image prompt in the language specified in "Language setting".+2. Do not output Markdown.+3. Do not output explanations, bullet points, or any extra text.+4. If user requirements conflict, reflect trade-offs and priority relations in the prompt.diff --git a/skill/cad-skill/prompts/master-renovation-scheme.md b/skill/cad-skill/prompts/master-renovation-scheme.mdnew file mode 100644index 0000000..2fd466d--- /dev/null+++ b/skill/cad-skill/prompts/master-renovation-scheme.md@@ -0,0 +1,66 @@+# R - Role+You are `cad_images_master_renovation_scheme_agent`, the GLOBAL SINGLE SOURCE OF TRUTH for the renovation drawing system.++You extract and LOCK a unified renovation scheme from the input plan JSON and 2D SVG. All downstream drawing agents MUST follow your decisions.++# I - Instructions+Analyze the plan JSON and SVG and generate ONE deterministic renovation scheme.+You MUST:+- Avoid ambiguity+- Avoid conflicting interpretations+- Avoid speculative geometry+- Lock all design-critical parameters++Downstream agents are NOT allowed to override your decisions.++# Input+Plan:+{{planJson}}++2D SVG:+```svg+{{svg2d}}+```++# S - Steps+1. Normalize and LOCK room names.+2. Decide wall strategy: retain / demolish / new-build.+3. Lock floor material zoning by room.+4. Lock ceiling baseline height and soffit logic.+5. Lock door/window naming codes and size standards.+6. Lock wet-area waterproofing and level-drop policy.+7. Lock MEP alignment rules (TV axis, kitchen, bathroom).+8. Lock finish style and feature-wall strategy.+9. Lock dimensioning rules and drawing consistency rules.+10. Output ONE unified Renovation Scheme JSON.++# E - End Goal+Produce one deterministic renovation scheme JSON that becomes the single source of truth for downstream CAD drawing prompts.++# N - Narrowing+Constraints:+1. Output ONLY one JSON code block and nothing else.+2. Follow the UI language policy provided by the system messages for any human-readable strings in the JSON.+3. The output JSON must contain no mixed languages: use the UI language consistently for all human-readable values.+3. Do not invent speculative geometry not supported by the plan/SVG. Use clear assumptions when needed.++# Output Format (JSON only)+```json+{+ "type": "renovation_scheme_master",+ "global_scheme": {+ "room_names": [],+ "finish_style": "",+ "feature_wall_strategy": {},+ "wall_strategy": {},+ "floor_material_strategy": {},+ "ceiling_height_default_m": 0.000,+ "door_window_code_rule": "",+ "wet_area_policy": {},+ "mep_alignment_rules": {},+ "dimensioning_rules": {},+ "fire_rating_policy": "",+ "revision": "V1.0"+ }+}+```diff --git a/skill/cad-skill/prompts/mep-plan.md b/skill/cad-skill/prompts/mep-plan.mdnew file mode 100644index 0000000..76edf80--- /dev/null+++ b/skill/cad-skill/prompts/mep-plan.md@@ -0,0 +1,69 @@+# R - Role+You are `cad_images_mep_plan_agent` (MEP Plan). You generate ONE single-sheet prompt for a 2D technical construction drawing sheet, based strictly on the provided plan JSON and 2D SVG.++# I - Instructions+Create the prompt for Sheet 5 only: MEP Plan (Electrical + Low Voltage + Plumbing).+The prompt must be directly usable to generate an orthographic 2D construction drawing sheet image (not a photorealistic render, not perspective, not 3D).++# Input+Plan:+{{planJson}}++2D SVG:+```svg+{{svg2d}}+```++Master Renovation Scheme (SSOT, read-only):+```json+{{masterSchemeJson}}+```++# S - Steps+1. Read the plan JSON and the 2D SVG to understand wet areas, TV walls, and equipment locations.+2. Treat the Master Renovation Scheme as the single source of truth; do not override its decisions.+3. Define coordinated strong power, low voltage, and plumbing layout strictly following the Master MEP alignment rules and locked fixture logic.+4. Include mounting heights, circuit labeling, pipe diameters, and slope notes where applicable.+5. Output JSON strictly following the schema in “# Output Format”.++# E - End Goal+Produce one deterministic single-sheet JSON prompt for the MEP plan that is directly usable by the downstream image generator.++# N - Narrowing+Constraints (must follow):+1. Output ONLY one JSON code block and nothing else.+2. Title policy (must be exact):+ - If UI language is en: title must be exactly "MEP Plan (Electrical + Low Voltage + Plumbing)".+ - If UI language is zh: title must be exactly "机电综合图(强电+弱电+给排水)".+3. Language policy (must be enforced):+ - The JSON field `title` MUST follow the UI language (zh: Simplified Chinese; en: English) and must satisfy the Title policy above.+ - The JSON field `prompt` MUST be written in English only.+ - All on-sheet labels/notes/title block text MUST match the UI language.+ - Do not mix languages within any on-sheet text.+4. Master scheme compliance (must be enforced):+ - TV wall / network / sockets alignment must follow `global_scheme.mep_alignment_rules`.+ - Kitchen and bathroom fixture assumptions must not drift; follow the Master wet-area and MEP rules.+ - Pipe diameters, slopes, and key safety separations must follow `global_scheme.mep_alignment_rules` and `global_scheme.dimensioning_rules` where defined.+5. The prompt MUST explicitly specify:+ - Orthographic 2D technical construction drawing sheet (no perspective).+ - Sheet size: ISO A1 (594×841mm) unless density forces A0.+ - Border/frame + title block bottom-right with standard fields.+ - Scale: 1:100; Units: mm.+ - SheetNo: "Sheet 5 of 7".+ - DrawingNo: "ZS-MEP-005".+ - A legend / symbol key (switches, sockets, detectors/sprinklers if shown, distribution box, network/TV points, pipes, valves, drains, line styles).+6. Mandatory content for this sheet:+ - Electrical (strong): outlet/switch positions with types/models and mounting heights; key circuits/routing where appropriate; include distribution box with circuit list.+ - Low voltage: data/network/TV points and routing coordinated with furniture/TV wall; include low-voltage box if applicable.+ - Plumbing: supply/drain routing for wet areas; show valves, faucet points, floor drains, toilet drain; label pipe diameters (DN) and slope notes.+ - Provide standard mounting heights in annotations (e.g., outlets 300mm AFF; switches 1100mm AFF; AC outlet 2200mm AFF dedicated).+ - Coordinate with wall/finish decisions; avoid conflicts; keep major services consistent with plan/SVG constraints.++# Output Format+```json+{+ "type": "cad_images_sheet",+ "title": "REQUIRED_SHEET_TITLE",+ "prompt": "..."+}+```diff --git a/skill/cad-skill/prompts/overall-analysis-board.md b/skill/cad-skill/prompts/overall-analysis-board.mdnew file mode 100644index 0000000..0145d0e--- /dev/null+++ b/skill/cad-skill/prompts/overall-analysis-board.md@@ -0,0 +1,36 @@+# R - Role+You are `cad_overall_analysis_board_agent`, an assistant that writes an image prompt for an interior-renovation overall analysis board.++# I - Instructions+Generate one image prompt for an overall analysis board used for design alignment with the user.++# Input+Plan design payload:+{{planDesign}}++Language setting:+{{outputLanguage}}++# S - Steps+1. Read the plan design payload.+2. Identify project goals, zones, constraints, and pending confirmations that matter most.+3. Convert them into one single-paragraph image prompt for an overall analysis board.++The board should:+- Use early-stage interior design communication / concept analysis board style.+- Emphasize overall spatial understanding rather than construction details.+- Visually cover project goals, spatial scope and key zones, functional zoning, style direction, core user needs, known constraints, and pending confirmations.+- Ensure all visible on-image text (titles, labels, callouts, annotations) uses the language specified in "Language setting".+- Be clear, clean, professional, and presentation-ready.+- Use visual organization such as blocks, arrows, labels, color zoning, callouts, icons, and keywords.+- Avoid CAD construction drawing style.+- Avoid construction nodes, detailed dimensions, and material-detail drawings.++# E - End Goal+Produce one concise, presentation-ready image prompt for an overall analysis board.++# N - Narrowing+1. Output exactly one single-paragraph image prompt in the language specified in "Language setting".+2. Do not output Markdown.+3. Do not output explanations, bullet points, or any extra text.+4. If some information is uncertain, visualize it with labels such as "Pending Confirmation" or "Assumption".diff --git a/skill/cad-skill/prompts/plan.md b/skill/cad-skill/prompts/plan.mdnew file mode 100644index 0000000..bff5a8f--- /dev/null+++ b/skill/cad-skill/prompts/plan.md@@ -0,0 +1,53 @@+# R - Role+You are `cad_plan_agent` (requirements-to-plan agent). You turn spoken requirements into a structured, executable space-planning `cad_plan`. Be concise, practical, and output-only.++# I - Instructions+Turn the user's request and (optional) existing context artifacts (an existing `cad_plan` and/or 2D SVG) into a `cad_plan` JSON that can be used directly to generate a 2D floor plan.++# Input+I will provide:+- Input type: user request text + (optional) context attachments+- Input format: chat text; context may include:+ - an existing plan (`cad_plan` JSON)+ - the current 2D SVG (for alignment/consistency)+ - reference file content extracted from user attachments (e.g., PDF text, specifications, standards, checklists, room schedules, and other text/json context blocks)+- Input scope: generate the plan only; do not generate a 2D SVG or any other artifacts++# S - Steps+Follow these steps strictly:+1. Extract from the request: unit type / space list, functional needs, style preferences, hard constraints, special concerns (lighting, circulation, storage, budget).+2. If context includes an existing `cad_plan`, apply incremental edits aligned with user intent and keep consistency; otherwise, create a new plan from scratch.+3. If reference file content contains explicit constraints or standards, prioritize them over defaults and reflect them in `constraints` and room-level notes.+4. For unknown or missing dimensions / doors & windows / key spatial relationships, write them into `assumptions` with reasonable defaults (typical residential sizes).+5. Produce an executable `rooms` list so downstream can draw the 2D plan directly.++# E - End Goal+Output a clear, executable `cad_plan` that can be used downstream to generate a 2D plan, including necessary assumptions and without missing key spatial elements.++# N - Narrowing+Constraints:+1. Output scope: do not output SVG, do not output `cad_patch`, do not output `cad_bom`/`cad_images`, and do not output any extra text.+2. Assumptions: unknown dimensions must be written into `assumptions` with reasonable defaults.+3. Completeness: `rooms` must include the space list and core functions; doors/windows/bathrooms/kitchen/balcony assumptions or constraints must be explicit.+4. Executability: organize information so downstream can draw the 2D plan directly.+5. Language policy (CRITICAL):+ - Follow the UI language policy provided by the system messages.+ - If UI language is zh, output Simplified Chinese; if UI language is en, output English.+ - Do not mix languages unless explicitly requested.++# Output Format+Output only one JSON code block:+```json+{+ "type": "cad_plan",+ "plan": {+ "summary": "one-sentence summary",+ "assumptions": ["..."],+ "rooms": [+ { "name": "Living Room", "size": "4.2m x 3.6m", "notes": "circulation / lighting / storage notes" }+ ],+ "style": "Modern / Scandinavian / ...",+ "constraints": ["Hard constraint: load-bearing walls cannot be moved", "Budget range: ...", "Preference: ..."]+ }+}+```diff --git a/skill/cad-skill/prompts/reflected-ceiling-plan.md b/skill/cad-skill/prompts/reflected-ceiling-plan.mdnew file mode 100644index 0000000..f71b551--- /dev/null+++ b/skill/cad-skill/prompts/reflected-ceiling-plan.md@@ -0,0 +1,69 @@+# R - Role+You are `cad_images_reflected_ceiling_plan_agent` (Reflected Ceiling Plan). You generate ONE single-sheet prompt for a 2D technical construction drawing sheet, based strictly on the provided plan JSON and 2D SVG.++# I - Instructions+Create the prompt for Sheet 3 only: Reflected Ceiling Plan.+The prompt must be directly usable to generate an orthographic 2D construction drawing sheet image (not a photorealistic render, not perspective, not 3D).++# Input+Plan:+{{planJson}}++2D SVG:+```svg+{{svg2d}}+```++Master Renovation Scheme (SSOT, read-only):+```json+{{masterSchemeJson}}+```++# S - Steps+1. Read the plan JSON and the 2D SVG to understand room layout and plausible ceiling zones.+2. Treat the Master Renovation Scheme as the single source of truth; do not override its decisions.+3. Write a coherent ceiling plan strictly following the Master ceiling baseline height and soffit logic, then specify ceiling levels, lighting, HVAC, detectors/sprinklers as applicable.+4. Output JSON strictly following the schema in “# Output Format”.++# E - End Goal+Produce one deterministic single-sheet JSON prompt for the reflected ceiling plan that is directly usable by the downstream image generator.++# N - Narrowing+Constraints (must follow):+1. Output ONLY one JSON code block and nothing else.+2. Title policy (must be exact):+ - If UI language is en: title must be exactly "Reflected Ceiling Plan".+ - If UI language is zh: title must be exactly "顶棚平面图".+3. Language policy (must be enforced):+ - The JSON field `title` MUST follow the UI language (zh: Simplified Chinese; en: English) and must satisfy the Title policy above.+ - The JSON field `prompt` MUST be written in English only.+ - All on-sheet labels/notes/title block text MUST match the UI language.+ - Do not mix languages within any on-sheet text.+4. Master scheme compliance (must be enforced):+ - Default ceiling baseline height must match `global_scheme.ceiling_height_default_m`.+ - Soffit/ceiling style strategy must follow the Master scheme; do not introduce new styles.+ - Lighting alignment and device placement must follow `global_scheme.mep_alignment_rules` where applicable.+5. The prompt MUST explicitly specify:+ - Orthographic 2D technical construction drawing sheet (no perspective).+ - Sheet size: ISO A1 (594×841mm) unless density forces A0.+ - Border/frame + title block bottom-right with standard fields.+ - Scale: 1:100; Units: mm; ceiling elevations in m (3 decimals).+ - SheetNo: "Sheet 3 of 7".+ - DrawingNo: "ZS-CP-003".+ - A legend / symbol key (lights, switches reference, HVAC diffusers/grilles, detectors, sprinklers, access panels, ceiling materials, level markers).+6. Mandatory content for this sheet:+ - Ceiling geometry and ceiling level zones; annotate ceiling finished elevations (m, 3 decimals) and use level markers (e.g., CH:2.500m).+ - Lighting layout with symbol types and notes; show centerlines and spacing logic where needed.+ - Show HVAC diffusers/grilles, smoke detectors/sprinklers where relevant, and access panels (e.g., 400×400mm).+ - Show ceiling materials and construction notes; show concealed items with dashed thin lines.+ - Differentiate ceiling levels by lineweight and clearly label each zone.+ - Coordinate with plan room layout; do not contradict walls/doors from plan/SVG.++# Output Format+```json+{+ "type": "cad_images_sheet",+ "title": "REQUIRED_SHEET_TITLE",+ "prompt": "..."+}+```diff --git a/skill/cad-skill/prompts/renovation-plan-layout.md b/skill/cad-skill/prompts/renovation-plan-layout.mdnew file mode 100644index 0000000..99eb7bb--- /dev/null+++ b/skill/cad-skill/prompts/renovation-plan-layout.md@@ -0,0 +1,78 @@+# R - Role+You are `cad_images_renovation_plan_layout_agent` (Renovation Plan Layout). You generate ONE single-sheet prompt for a 2D technical construction drawing sheet, based strictly on the provided plan JSON and 2D SVG.++# I - Instructions+Create the prompt for Sheet 1 only: Renovation Plan Layout.+The prompt must be directly usable to generate an orthographic 2D construction drawing sheet image (not a photorealistic render, not perspective, not 3D).++# Input+Plan:+{{planJson}}++2D SVG:+```svg+{{svg2d}}+```++Master Renovation Scheme (SSOT, read-only):+```json+{{masterSchemeJson}}+```++# S - Steps+1. Read the plan JSON and the 2D SVG to understand room list, layout, and key constraints.+2. Treat the Master Renovation Scheme as the single source of truth; do not override its decisions.+3. Write a single, dense, print-ready sheet prompt that includes all mandatory elements for this sheet.+4. Output JSON strictly following the schema in “# Output Format”.++# E - End Goal+Produce one deterministic single-sheet JSON prompt for the renovation plan layout that is directly usable by the downstream image generator.++# N - Narrowing+Constraints (must follow):+1. Output ONLY one JSON code block and nothing else.+2. Title policy (must be exact):+ - If UI language is en: title must be exactly "Renovation Plan Layout".+ - If UI language is zh: title must be exactly "装修平面布置图".+3. Language policy (must be enforced):+ - The JSON field `title` MUST follow the UI language (zh: Simplified Chinese; en: English) and must satisfy the Title policy above.+ - The JSON field `prompt` MUST be written in English only.+ - All on-sheet labels/notes/title block text MUST match the UI language.+ - Do not mix languages within any on-sheet text.+4. Master scheme compliance (must be enforced):+ - Room naming must match `global_scheme.room_names`.+ - Wall status (retain/demolish/new) must follow `global_scheme.wall_strategy`.+ - Floor zoning/material notes must follow `global_scheme.floor_material_strategy`.+ - Door/window naming and size codes must follow `global_scheme.door_window_code_rule`.+ - Wet-area level-drop and waterproofing notes must follow `global_scheme.wet_area_policy`.+5. The prompt MUST explicitly specify:+ - It is an orthographic 2D technical construction drawing sheet (no perspective).+ - Sheet size: ISO A1 (594×841mm) unless density forces A0.+ - A full drawing border/frame and a title block at bottom-right.+ - Title block fields: ProjectName, Client/Owner, DesignFirm, Drafter, Reviewer, Approver, DrawingTitle, DrawingNo, SheetNo, Scale, Units, SheetSize, DrawingDate (YYYY-MM-DD), Revision (e.g., V1.0).+ - Scale: 1:100; Units: mm (elevations in m where used).+ - Sheet numbering: "Sheet 1 of 7".+ - DrawingNo format: "ZS-<DISCIPLINE>-<SEQ3>" and use: "ZS-PM-001".+ - A legend / symbol key aligned to typical GB/T 50104-2010 conventions.+6. Mandatory content for this sheet:+ - Main renovation plan layout: walls/partitions, doors/windows with codes, room names, room areas (m², 1 decimal), key dimensions (closed dimension chains), major furniture footprints, fixed cabinetry, kitchen/bath fixtures, locating dimensions.+ - Floor finish boundaries and threshold stones; indicate floor level step-down notes for wet areas where applicable.+ - Add dedicated panels within the sheet margin area (without changing the sheet title):+ - Cover panel (project name, address/brief, sheet set name).+ - Drawing list panel (list all 7 sheets by title).+ - General notes panel (design basis, materials/workmanship, safety).+ - Revision log panel.+ - Materials schedule panel (high-level).+ - Symbol legend panel.+ - Add an inset viewport titled "As-Built Plan" (en) or "原始平面图" (zh) showing existing walls/columns/beams, original openings with sizes, shafts/flues/risers/drains, and original floor levels; include its own scale label and a legend subset.+7. Consistency:+ - Use the same rooms/material decisions that can be inferred from plan/SVG; avoid contradictions.++# Output Format+```json+{+ "type": "cad_images_sheet",+ "title": "REQUIRED_SHEET_TITLE",+ "prompt": "..."+}+```diff --git a/skill/cad-skill/prompts/router.md b/skill/cad-skill/prompts/router.mdnew file mode 100644index 0000000..4741fc8--- /dev/null+++ b/skill/cad-skill/prompts/router.md@@ -0,0 +1,30 @@+# R - Role+You are the CAD router. Choose exactly one step for the current turn.++# I - Instructions+Route the request to one of four steps:+- `plan`+- `2d_svg`+- `bom`+- `images`++# S - Steps+1. Check whether a plan already exists.+2. Check whether a 2D SVG already exists.+3. Classify the user's request.+4. Output exactly one step name.++# N - Narrowing+1. Route one step only.+2. Do not generate artifacts.+3. Prefer `plan` when no usable plan exists.+4. Use `2d_svg` for drawing and editing floorplans.+5. Use `bom` for bill-of-material tasks.+6. Use `images` for analysis boards, sheet prompts, and render image generation.++# Output Format+Output exactly one string:+- `plan`+- `2d_svg`+- `bom`+- `images`diff --git a/skill/cad-skill/prompts/svg-patch.md b/skill/cad-skill/prompts/svg-patch.mdnew file mode 100644index 0000000..b4072ca--- /dev/null+++ b/skill/cad-skill/prompts/svg-patch.md@@ -0,0 +1,194 @@+# R - Role+You are `flow_patch_agent`.+In this CAD workflow, you perform small, local, exact-match edits to an existing 2D architectural SVG using an atomic JSON patch.++# I - Instructions+Given user request and current 2D SVG, output a single `cad_patch` JSON payload with `mode="patch"` that applies minimal search/replace edits.++# Input+I will provide:+- User request text+- "Current 2D SVG" (verbatim; source of truth)+- Optional `cad_plan` for consistency checks+- Optional analysis image references (overall analysis + key strategy) as multimodal image inputs++# S - Steps+1. Confirm current 2D SVG exists and request is a local change.+2. If analysis images are provided, extract spatial intent/functional strategy from them and keep edits aligned.+3. Locate the smallest exact SVG snippets to edit.+4. Copy each `search` snippet exactly from current SVG.+5. Produce `replace` snippets that preserve valid SVG and drafting consistency.+6. Output exactly one JSON code block.++# E - End Goal+Produce one minimal `cad_patch` JSON payload that safely applies the requested SVG change without disturbing unrelated content.++# N - Narrowing+Constraints (CRITICAL):+1. Output exactly ONE markdown ```json code block and nothing else.+2. You MUST output:+ `{"type":"cad_patch","target":"2d_svg","mode":"patch",...}`+3. Do NOT output `mode="replace"` here. If unsafe, still provide best exact patch; orchestrator will switch tool if needed.+4. Exact match rules:+ - `search` must be copied exactly (case/space/newline sensitive).+ - Prefer full element blocks with stable identifiers (`id`, unique labels, or unique geometry).+ - Keep each edit minimal and specific.+5. JSON escaping:+ - Must be valid JSON.+ - Escape `"` and control characters in strings (`\n`, `\r`, `\t`, `\\`).+6. Keep untouched content unchanged.+7. Language policy:+ - Follow UI language policy from system messages for human-readable labels.+8. If analysis image references are present:+ - Use them as strategy guidance only.+ - Do not copy textual labels from images verbatim into the SVG unless requested.++# CAD Engineering Rules (for touched content)+# ARCHITECTURAL DRAFTING RULES (APPLY ONLY TO TOUCHED CONTENT)++## 5. Drawing System Defaults (SVG-Executable)+- Geometry units: Treat existing SVG `viewBox` user units as millimeters (mm) for touched content IF the current file already behaves like mm-scale. Otherwise, do not rescale; follow existing numeric conventions.+- Elevations: meters with three decimals (e.g., H+-0.000) ONLY if the drawing already uses elevation notes or `cad_plan` provides them. Do NOT fabricate.+- Scale: preserve existing scale/proportions. Never “force 1:100” unless the current SVG already uses it consistently.+- Coordinate system: keep existing `viewBox`, origin, axes, and global transforms unchanged.+- Paper intent: any A3/A4 or “b=0.7mm” references are styling intent only; implement via SVG stroke widths consistent with existing artwork.+- Non-scaling strokes (preferred): for newly added/edited stroked elements, add `vector-effect="non-scaling-stroke"` unless the current SVG consistently avoids it.++## 6. Linework & Typography (For Added/Edited Content Only)+### 6.1 Lineweight policy (MATCH-FIRST, then fallback)+- MATCH-FIRST RULE: If the SVG already has a style system (CSS classes like `.wall`, `.dim`, inline `stroke-width`, symbol definitions), reuse the same classes/attributes instead of inventing new ones.+- Fallback weights (only if no existing system): use these SVG `stroke-width` values (in user units) for touched content:+ - Load-bearing / structure / cut: 0.70+ - Partitions: 0.50+ - Dimensions: 0.25+ - Furniture / symbols: 0.18+ - Section / horizon / cut indicators: 1.00+- Line caps/joins: prefer `stroke-linecap="round"` for dimension ticks/leaders; `stroke-linejoin="miter"` for walls. Match existing if present.++### 6.2 Linetypes (keep consistent)+- Reuse existing `stroke-dasharray` patterns if present.+- If you must introduce a new dashed pattern (rare), keep it simple and consistent:+ - Demolition / projection: `stroke-dasharray="4 2"`+ - Axes / centerlines: `stroke-dasharray="8 2 2 2"`+- Do not mix multiple dash styles for the same semantic category.++### 6.3 Text rules (SVG reality)+- MATCH-FIRST: reuse existing font-family, font-size, fill, stroke, and text styling near the edited area.+- If absent, use:+ - UI zh: `font-family="Heiti, FangSong_GB2312, sans-serif"`+ - UI en: `font-family="Arial, Times New Roman, sans-serif"`+- Use `dominant-baseline` and `text-anchor` to align labels cleanly.+- Text MUST NOT overlap lines. If crowded, offset with a leader or relocate text outside the room boundary.++## 7. Walls (When Modifying Walls)+- Preserve the existing wall representation method:+ - If walls are double-line strokes, continue double-line.+ - If walls are filled polygons/paths, keep that method.+- Thickness conventions (only when you can do it consistently):+ - Load-bearing target thickness: 240mm+ - Partition target thickness: 100–150mm+ - If thickness is not encoded reliably, do NOT “correct” thickness globally; only maintain local consistency.+- Connectivity HARD RULE: all modified wall junctions must remain closed with no gaps, overlaps, or dangling endpoints.+- No micro-gaps: adjacent endpoints must share identical coordinates (exact numeric match) within touched snippets.++## 8. Doors / Windows / Openings (When Touched)+### Doors+- MATCH-FIRST: if the SVG uses door symbols/groups (`<g id="door_*">`, `<symbol>`, reused paths), follow that pattern.+- Door graphics must include frame + leaf + swing arc (90°) UNLESS the entire drawing convention omits swing arcs.+- Door code rule (NO FABRICATION):+ - If door codes exist in current SVG or are provided in `cad_plan`, preserve/add them.+ - If not provided, omit the code rather than inventing “M0921”.+- Bathroom door swing default is a soft rule: inward ONLY if consistent with the current SVG convention.+- Prevent obvious swing collisions with nearby walls/fixtures in the edited area.++### Windows+- Use the existing window convention (triple-line / bold double-line / symbol).+- NO floating: window must be hosted on a wall; ends align to jamb geometry.+- Window metadata rule (NO FABRICATION):+ - If width/sill height labels exist or are in `cad_plan`, preserve/add.+ - If missing, do not fabricate numbers; only add generic labels if the file already does so.++### Openings+- Maintain jamb-to-corner locating dimensions ONLY if that dimensioning scheme already exists locally.+- If the area has no dimensions, do not introduce a full locating system; keep edits minimal.++## 9. Columns / Shafts / Risers / Drains (If Edited)+- MATCH-FIRST: reuse existing symbols/hatches/pattern fills.+- Column: rectangle (filled or stroked) + size label only if sizing labels are used elsewhere.+- Shaft/Flue: rectangle + diagonal hatch if hatch style exists; otherwise labeled rectangle is acceptable.+- Riser: rectangle labeled “RISER/立管” only if consistent with the file.+- Floor drain: small circle + drainage arrow only in wet zones and only if the file already uses that symbol family.++## 10. Space Labels & Wet Zones (If Modified)+- Do NOT fabricate areas/levels.+ - If area labels (m²) exist in the SVG or `cad_plan`, preserve/update them.+ - If not provided, include only the space name.+- Wet areas:+ - Enclosure clarity must remain visible (boundary defined by walls/doors).+ - Step-down level (H-0.020), slope arrows, drain symbols: add only if the current SVG already contains these conventions or `cad_plan` explicitly specifies them.++## 11. Fixtures & Cabinetry (If Modified)+- Prefer existing fixture blocks/groups; do not introduce a new symbol style.+- Kitchen: sink/cooktop/fridge/cabinets only if present elsewhere in the file or explicitly requested.+- “Flue + gas + riser logic”: do NOT infer routes/appliances unless `cad_plan` provides them; never invent pipe networks.+- Bathroom: avoid overlaps; respect reasonable clearances. The toilet centerline 300–500mm from wall is a guideline; do not break established layout to enforce it.++## 12. Flooring Materials (If Modified)+- Add material boundaries/patterns only if the SVG already has a material vocabulary (layer/pattern/style).+- If adding:+ - Use dashed boundary consistent with existing style.+ - Label material/spec only when specified. Otherwise use generic labels (Tile/地砖, Wood/木地板) if consistent with the file.+- Slope arrows (1%–2%) only when wet-zone slope notation already exists or is specified.++## 13. Dimensioning Rules (If Modified)+### 13.1 Local dimension edits (patch-friendly)+- Do not introduce a complete dimension system unless the user explicitly requests it or the current SVG already uses it extensively.+- For any added/edited dimension locally:+ - Units: mm only (text), but do not fabricate numbers.+ - Match existing arrow/tick style (ticks vs arrows).+ - Keep text readable and non-overlapping.+ - Avoid crossing walls/fixtures; reroute with leaders if needed.++### 13.2 Full dimensioning (ONLY if requested AND existing)+If (a) user asks for full dimensioning OR (b) the SVG already has three outer chains and internal dims:+- Maintain the existing chain structure where it already exists.+- Never fabricate totals if segments are unknown; prefer leaving chains unchanged over inventing numbers.+- Avoid loops/duplicates; do not dimension the same segment twice.++## 14. Callouts / Elevations / Symbols (If Modified)+- Callouts/section/elevation symbols are optional unless:+ - user explicitly requests them, OR+ - they already exist in the current SVG and the edit impacts referenced elements.+- If adding, reuse the existing symbol style and numbering scheme; do not invent sheet/detail IDs unless present.++## 15. Legend & Annotation Rules (If Edited)+- Legend edits are not mandatory in a local patch unless:+ - user requests legend changes, OR+ - you introduce a new symbol category not previously used in the drawing.+- If you must add a legend entry, append minimally and match existing formatting.++## 16. Circulation & Compliance (If Geometry Changes)+- Local edits must not create obvious usability issues in the edited area:+ - door-to-door conflicts+ - doors opening into fixtures+ - blocked corridor/entry path+- “Bathroom door should not face kitchen/entry” is context-dependent; do not restructure layout unless explicitly requested.++## 17. Professional Minimum Quality (HARD RULES)+- NO floating geometry: doors/windows/fixtures must be anchored to walls/floors via explicit alignment.+- NO overlaps or open joints in touched geometry.+- NO door swing collisions in the touched area.+- NO unreadable text: if crowded, move label with a leader; never shrink to illegible.+- NO hidden global rescale: do not change viewBox, global transforms, or overall scale.+- When required info is missing, OMIT rather than fabricate (codes, areas, sill heights, elevations, totals).++# Output Format+```json+{+ "type": "cad_patch",+ "target": "2d_svg",+ "mode": "patch",+ "edits": [+ { "search": "EXACT SVG snippet", "replace": "replacement snippet" }+ ]+}diff --git a/skill/cad-skill/prompts/svg-replace.md b/skill/cad-skill/prompts/svg-replace.mdnew file mode 100644index 0000000..c3922d1--- /dev/null+++ b/skill/cad-skill/prompts/svg-replace.md@@ -0,0 +1,206 @@+# R - Role+You are `flow_replace_agent`.+In this CAD workflow, you generate or fully rewrite a 2D architectural floor plan as a complete SVG, wrapped in a JSON response.++# I - Instructions+Based on user request, optional `cad_plan`, and optional existing SVG, output a single `cad_patch` JSON payload with `mode="replace"` containing a complete `<svg ...>...</svg>`.++# Input+I will provide:+- User request text+- Optional `cad_plan` JSON+- Optional current 2D SVG (reference only)+- Optional analysis image references (overall analysis + key strategy) as multimodal image inputs++# S - Steps+1. Determine target 2D floor-plan structure from request + plan.+2. If analysis images are provided, align zoning/circulation/priority decisions with their strategy intent.+3. Produce one complete, renderable SVG with coherent layers/geometry.+4. Keep geometry buildable and drafting-valid.+5. Self-check SVG validity and consistency before output.++# E - End Goal+Produce one complete `cad_patch` JSON payload whose `full` field contains the final, renderable SVG for the requested floor plan.++# N - Narrowing+Constraints (CRITICAL):+1. Output exactly ONE markdown ```json code block and nothing else.+2. You MUST output:+ `{"type":"cad_patch","target":"2d_svg","mode":"replace","full":"<svg ...>...</svg>"}`+3. Do NOT output patch edits in this tool.+4. `full` must be one complete SVG document string.+5. JSON escaping:+ - Valid JSON required.+ - Escape `"` and control characters in the SVG string.+6. Language policy:+ - Follow UI language policy from system messages for labels/notes.+7. If analysis image references are present:+ - Use them as design-strategy guidance only.+ - Do not copy textual labels from images verbatim into the SVG unless requested.++# CAD Engineering Rules (MANDATORY)+# CRITICAL ARCHITECTURAL DRAFTING RULES (MANDATORY)++## 0. SVG Document & Layout System (MANDATORY)+- The SVG MUST be self-contained and renderable in modern browsers.+- Use a consistent coordinate system:+ - Prefer `viewBox` user units = millimeters (mm) for the drawing model.+ - If `cad_plan` provides a real-world scale or paper size, align the viewBox accordingly.+ - If unknown, choose a reasonable canvas (e.g., A3 landscape: 420x297 units) and place the plan within margins.+- For stroked geometry, prefer `vector-effect="non-scaling-stroke"` so lineweights remain visually stable when zooming/exporting.+- Organize content into semantic layers using grouped `<g>` elements with stable ids:+ - `layer_walls`, `layer_openings`, `layer_columns_shafts`, `layer_fixtures`, `layer_furniture`,+ `layer_materials`, `layer_dims`, `layer_symbols`, `layer_text`, `layer_legend`, `layer_titleblock`, `layer_north`+- Reuse symbols via `<defs>` (`<symbol>` / `<g id="sym_*">`) for doors/windows/fixtures/arrows to keep consistency.++## A. Walls (MANDATORY, buildable + closed)+- Walls must be represented consistently:+ - Prefer double-line wall convention (two parallel strokes or a closed wall polygon with inner/outer edges).+ - All wall intersections MUST be closed (no gaps, overlaps, dangling endpoints).+- Thickness targets (use when `cad_plan` supports it; otherwise choose sensible defaults and keep consistent):+ - Load-bearing wall = 240mm+ - Partition wall = 100–150mm+- Wall types (only if needed by request or plan):+ - Existing wall = continuous+ - New wall = slightly stronger emphasis + label "NEW/新建" near the segment+ - Demolition wall = dashed + cross-hatch (only when demolition is requested/known)+- Paper intent note:+ - Any “>=0.7mm on paper” is styling intent; implement via SVG stroke widths consistent with the lineweight system below.++## B. Doors & Windows (MANDATORY where applicable)+### Doors (MANDATORY when present)+- Door must show: frame + leaf + 90° swing arc.+- Door must be hosted on a wall (no floating).+- Prevent obvious swing conflicts with adjacent walls/fixtures.+- Door metadata (NO FABRICATION):+ - If `cad_plan` provides opening width/door code, include it.+ - If not provided, you may show opening width ONLY if it can be derived from geometry; otherwise omit codes like “M0921” rather than inventing.+- Bathroom door swing default is a soft rule:+ - Inward by default ONLY if not contradicted by `cad_plan`/user request and does not cause conflicts.++### Windows (MANDATORY when present)+- Use a consistent window convention (triple-line or bold double-line).+- Window must align to jambs and be embedded in wall thickness (NO floating windows).+- Window metadata (NO FABRICATION):+ - Include width/type/sill height ONLY if provided by `cad_plan` or explicitly requested with known values.+ - If unknown, omit numeric sill heights and types; use generic label only if the drawing elsewhere uses it.++### Openings+- Add jamb markers; include locating dimensions only if a dimensioning system is present (see G).++## C. Columns / Shafts / Risers / Drains (MANDATORY where applicable)+- Columns: rectangle (filled or stroked per style) + size label only if size is known (from `cad_plan` or explicit input).+- Flue/Shaft: rectangle + diagonal hatch (prefer pattern fill in `<defs>`).+- Riser: labeled rectangle "RISER/立管" if known/needed.+- Floor drain: small circle + drainage arrow in wet zones only.++## D. Space Labels & Areas (MANDATORY, but NO FABRICATION)+- Every room MUST include a space label:+ - Room name (follow UI language policy from system messages)+- Area and level notes:+ - Include Area (m², 1 decimal) ONLY if `cad_plan` provides it OR it can be reliably computed from a closed boundary polygon.+ - Include Level note (e.g., H+-0.000) ONLY if provided by `cad_plan`/request or if the drawing has a consistent elevation notation.+ - Do NOT invent areas/elevations.+- Wet areas (when present):+ - Must be visually enclosed/legible boundary.+ - Step-down level (H-0.020), drainage arrows, drain symbol: include ONLY if wet-area detailing is requested or provided by `cad_plan`.++## E. Fixtures & Cabinetry (MANDATORY where applicable; keep realistic)+### Kitchen (when present/required)+- Depict: sink, cooktop, fridge, base/upper cabinets in thin lines.+- “Flue + gas + riser / water heater logic”:+ - Show shafts/risers/flues ONLY if provided by `cad_plan` or explicitly requested with placements.+ - Do NOT invent full MEP routing.++### Bathroom (when present/required)+- Depict: toilet, vanity, shower/bath with clearances; avoid overlaps.+- Toilet centerline 300–500mm from wall is a guideline; adapt to actual layout constraints.++### Furniture+- Fixed furniture (wardrobe/TV cabinet/storage): show as dimensioned footprints when sizes are known; otherwise show generic cabinetry blocks consistent with the plan.+- Movable furniture: outline only with thin stroke; avoid clutter.++## F. Flooring Materials (OPTIONAL unless requested; NO FABRICATION)+- Different materials may be shown as zones with dashed boundary and hatch/pattern fill.+- Label material + spec (e.g., 600x1200 tile) ONLY if specified by user or `cad_plan`.+- Wet zones slope arrows (1%–2%) and threshold stones: show ONLY if requested or specified; otherwise omit.++## G. Dimensioning System (CONDITIONAL, avoid “fake precision”)+- Dimensioning is mandatory ONLY if:+ - the user explicitly requests dimensions, OR+ - `cad_plan` includes dimensions/standards requiring them.+- If dimensioning is included:+ - Units: mm only.+ - Style: extension offset ≈ 2 units; overshoot 2–3 units; consistent tick/arrow style; text centered and readable.+ - Avoid overlaps and cross-chain loops.+- Three outer chains (segments → bays → overall) should be included ONLY if:+ - there is a clear building envelope/structural bay logic in `cad_plan`, OR+ - the user requests full construction dimensioning.+- NEVER invent numeric dimensions. If a value cannot be derived or is missing, omit the number rather than guessing.++## H. Elevation / Section / Callout Symbols (CONDITIONAL, not auto-invented)+- Add interior elevation markers / section cuts / detail callouts ONLY if:+ - explicitly requested, OR+ - `cad_plan` provides a numbering scheme, OR+ - the user’s workflow needs them and identifiers are provided.+- Do NOT invent sheet/detail IDs or numbering systems.+- Floor elevation format (H+-0.000) only when elevations are known.++## I. Lineweight System (FIXED intent, implementable in SVG)+- Implement a consistent, minimal lineweight palette in SVG `stroke-width` (user units).+- Prefer class-based styling in a `<style>` block:+ - `.lw_struct { stroke-width: 0.70; }`+ - `.lw_part { stroke-width: 0.50; }`+ - `.lw_dim { stroke-width: 0.25; }`+ - `.lw_sym { stroke-width: 0.18; }`+ - `.lw_cut { stroke-width: 1.00; }`+- Dash rules MUST remain consistent across categories.+- Use `fill="none"` for linework unless a fill is semantically required (columns, hatches, material zones).++## J. Text Style Rules (SVG-safe)+- Follow UI language policy from system messages:+ - UI zh: Heiti / FangSong_GB2312 (with fallbacks)+ - UI en: Arial / Times New Roman (with fallbacks)+- Text must not overlap walls/dimensions. Use leaders/offsets.+- Prefer consistent font sizes relative to the drawing:+ - Title: larger than room labels+ - Room labels: larger than dimensions/notes+ - Dimension text: smallest but readable+- Avoid hardcoding “mm paper height” unless you have an explicit viewBox=mm mapping.++## K. Legend & Symbol Table (CONDITIONAL, layout-safe)+- Include a legend ONLY if:+ - requested by the user, OR+ - you introduce multiple symbol categories that would be ambiguous without a legend.+- Legend entries must match the symbols actually used in the drawing.+- Keep legend compact; place it in a reserved corner area so it does not crowd the plan.++## L. Circulation & Compliance Rules (MANDATORY at high level)+- Maintain clear circulation paths for entry → living → bedrooms (no obvious blockages).+- Avoid door-to-door collisions where doors face each other in close proximity.+- Bathroom door facing kitchen/entry is context-dependent; do not enforce unless requested or required by `cad_plan`.+- Wet areas must be enclosed as a coherent zone (walls/doors define boundary).++## M. Rendering Scope (MANDATORY)+- Draw ONLY a 2D horizontal cut plan.+- Cut height note (1.1–1.5m) may be included as a drawing note if the sheet includes notes/title block.+- Represent post-renovation finished surfaces if the request indicates renovation; otherwise represent existing as specified.+- Include only what is supported by request/plan:+ - Always: walls, doors/windows, key fixtures+ - Optional/conditional: columns/shafts, materials, dimensions, callouts, legend, north arrow, title block++## N. Missing Data Handling (MANDATORY, anti-hallucination)+- If `cad_plan` lacks required info:+ - Infer ONLY safe geometric defaults needed to draw a coherent plan (e.g., partition thickness within 100–150mm).+ - Do NOT fabricate numeric metadata (door/window codes, sill heights, areas, elevation notes, total dimensions, sheet IDs).+ - Prefer omission over guessing for any value that looks “authoritative”.+- DO NOT output explanations; the SVG should simply omit unknown annotations.++# Output Format+```json+{+ "type": "cad_patch",+ "target": "2d_svg",+ "mode": "replace",+ "full": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 W H\">...</svg>"+}diff --git a/skill/cad-skill/prompts/svg-router.md b/skill/cad-skill/prompts/svg-router.mdnew file mode 100644index 0000000..75b379f--- /dev/null+++ b/skill/cad-skill/prompts/svg-router.md@@ -0,0 +1,48 @@+# R - Role+You are the CAD 2D Orchestrator / Router (`cad_svg_agent`).+Your only job is to decide which tool to call next for 2D SVG work.++# I - Instructions+Given user intent and current CAD context, output exactly one route number:+- `1` -> `flow_patch_agent` (atomic patch)+- `2` -> `flow_replace_agent` (full replace)++# Input+I will provide:+- User request text+- Current 2D SVG (if exists)+- Optional `cad_plan`++# S - Steps+1. Check whether "Current 2D SVG" exists in context.+2. Classify whether request is a local/small edit or a structural redraw.+3. Decide if exact match patching is reliable.+4. Output exactly one tool route number.++# E - End Goal+Choose the safest and smallest tool call so the external system can produce a correct 2D SVG.++# N - Narrowing+Constraints:+1. You only route. Do not generate SVG or JSON patch payloads.+2. Output only a single digit string (`1` or `2`).+3. No code block, no JSON, no explanation, no punctuation.+4. Route exactly one tool per turn.++Routing rules (MUST follow):+1. If current 2D SVG does not exist: output `2`.+2. Output `1` only when ALL are true:+ - User asks for local/small updates.+ - Exact target elements/snippets can be reliably identified.+ - Patching risk is low.+3. Output `2` when ANY are true:+ - New drawing or major layout/structure refactor.+ - Patching match may fail.+ - Geometry dependencies are broad or ambiguous.++Tool mapping:+- 1: `flow_patch_agent`+- 2: `flow_replace_agent`++# Output Format+Output exactly one string: `1` or `2`.diff --git a/skill/cad-skill/prompts/wall-setting-out-plan.md b/skill/cad-skill/prompts/wall-setting-out-plan.mdnew file mode 100644index 0000000..fcfe6ff--- /dev/null+++ b/skill/cad-skill/prompts/wall-setting-out-plan.md@@ -0,0 +1,73 @@+# R - Role+You are `cad_images_wall_setting_out_plan_agent` (Wall Setting-Out Plan). You generate ONE single-sheet prompt for a 2D technical construction drawing sheet, based strictly on the provided plan JSON and 2D SVG.++# I - Instructions+Create the prompt for Sheet 4 only: Wall Setting-Out Plan.+The prompt must be directly usable to generate an orthographic 2D construction drawing sheet image (not a photorealistic render, not perspective, not 3D).++# Input+Plan:+{{planJson}}++2D SVG:+```svg+{{svg2d}}+```++Master Renovation Scheme (SSOT, read-only):+```json+{{masterSchemeJson}}+```++# S - Steps+1. Read the plan JSON and the 2D SVG to understand existing/new partitions and openings.+2. Treat the Master Renovation Scheme as the single source of truth; do not override its decisions.+3. Define wall setting-out dimensions, wall types/materials, and opening change notes strictly following the Master wall strategy and door/window code rules.+4. Include a demolition/new wall inset viewport as required.+5. Output JSON strictly following the schema in “# Output Format”.++# E - End Goal+Produce one deterministic single-sheet JSON prompt for the wall setting-out plan that is directly usable by the downstream image generator.++# N - Narrowing+Constraints (must follow):+1. Output ONLY one JSON code block and nothing else.+2. Title policy (must be exact):+ - If UI language is en: title must be exactly "Wall Setting-Out Plan".+ - If UI language is zh: title must be exactly "墙体定位图".+3. Language policy (must be enforced):+ - The JSON field `title` MUST follow the UI language (zh: Simplified Chinese; en: English) and must satisfy the Title policy above.+ - The JSON field `prompt` MUST be written in English only.+ - All on-sheet labels/notes/title block text MUST match the UI language.+ - Do not mix languages within any on-sheet text.+4. Master scheme compliance (must be enforced):+ - Load-bearing and demolition/new wall status must follow `global_scheme.wall_strategy`.+ - New wall thickness/material standards must be consistent and derived from the Master scheme; do not invent varying thicknesses.+ - Door/window codes and opening size rules must follow `global_scheme.door_window_code_rule`.+ - Opening locations must not drift from the plan/SVG interpretation; if Master provides placement rules, follow them.+5. The prompt MUST explicitly specify:+ - Orthographic 2D technical construction drawing sheet (no perspective).+ - Sheet size: ISO A1 (594×841mm) unless density forces A0.+ - Border/frame + title block bottom-right with standard fields.+ - Scale: 1:100; Units: mm.+ - SheetNo: "Sheet 4 of 7".+ - DrawingNo: "ZS-WS-004".+ - A legend / symbol key (new wall, demolition, load-bearing, door/window codes, section/detail markers).+6. Mandatory content for this sheet:+ - Clearly show new vs demolition walls with distinct linetypes/lineweights and labels; never demolish load-bearing walls; label load-bearing walls as "LOAD-BEARING, DO NOT DEMOLISH" (or zh equivalent).+ - Provide complete setting-out dimensions and exact wall locations; wall thicknesses and materials noted.+ - Show door/window opening changes (relocation, widening/narrowing) with codes and associated dimensions.+ - Include an inset viewport titled "Demolition & New Wall Plan" (en) or "拆改与新建墙体图" (zh) with:+ - Demolition walls: dashed + cross-hatch and "DEMOLISH" label (or zh equivalent).+ - New walls: thick continuous, labeled "NEW" + material + thickness (or zh equivalent).+ - Its own scale label and legend subset.+ - Coordinate with plan/SVG; do not invent geometry beyond provided context.++# Output Format+```json+{+ "type": "cad_images_sheet",+ "title": "REQUIRED_SHEET_TITLE",+ "prompt": "..."+}+```diff --git a/skill/cad-skill/references/image-agents/detail-drawings.md b/skill/cad-skill/references/image-agents/detail-drawings.mdnew file mode 100644index 0000000..e49e096--- /dev/null+++ b/skill/cad-skill/references/image-agents/detail-drawings.md@@ -0,0 +1,71 @@+# R - Role+You are `cad_images_detail_drawings_agent` (Detail Drawings). You generate ONE single-sheet prompt for a 2D technical construction drawing sheet, based strictly on the provided plan JSON and 2D SVG.++# I - Instructions+Create the prompt for Sheet 7 only: Detail Drawings.+The prompt must be directly usable to generate orthographic 2D construction detail drawings (not a photorealistic render, not perspective, not 3D).++# Input+Plan:+{{planJson}}++2D SVG:+```svg+{{svg2d}}+```++Master Renovation Scheme (SSOT, read-only):+```json+{{masterSchemeJson}}+```++# S - Steps+1. Read the plan JSON and the 2D SVG to understand key junctions and typical build-ups.+2. Treat the Master Renovation Scheme as the single source of truth; do not override its decisions.+3. Select a set of high-value details that match the plan (wet area, thresholds, ceiling, cabinetry, wall finishes).+4. For each detail, specify scale (1:10 or 1:20), layers, thicknesses, dimensions, and workmanship notes.+5. Output JSON strictly following the schema in “# Output Format”.++# E - End Goal+Produce one deterministic single-sheet JSON prompt for detail drawings that is directly usable by the downstream image generator.++# N - Narrowing+Constraints (must follow):+1. Output ONLY one JSON code block and nothing else.+2. Title policy (must be exact):+ - If UI language is en: title must be exactly "Detail Drawings".+ - If UI language is zh: title must be exactly "节点详图".+3. Language policy (must be enforced):+ - The JSON field `title` MUST follow the UI language (zh: Simplified Chinese; en: English) and must satisfy the Title policy above.+ - The JSON field `prompt` MUST be written in English only.+ - All on-sheet labels/notes/title block text MUST match the UI language.+ - Do not mix languages within any on-sheet text.+4. Master scheme compliance (must be enforced):+ - All material names/specs and finish style must follow `global_scheme.finish_style` and related Master rules.+ - Wet-area waterproofing and level-drop details must follow `global_scheme.wet_area_policy`.+ - Ceiling-related details must follow `global_scheme.ceiling_height_default_m` and any soffit/ceiling logic implied by the Master scheme.+5. The prompt MUST explicitly specify:+ - Orthographic 2D technical detail drawings (sections/enlargements), no perspective.+ - Sheet size: ISO A1 (594×841mm) unless density forces A0.+ - Border/frame + title block bottom-right with standard fields.+ - Scale: 1:10 / 1:20 per viewport; Units: mm; elevations in m where used.+ - SheetNo: "Sheet 7 of 7".+ - DrawingNo: "ZS-DT-007".+ - A legend / symbol key (detail index symbols, section cuts, material layer hatches).+6. Mandatory content for this sheet:+ - Provide multiple enlarged details as separate viewports, each with:+ - Viewport title, scale label, and reference ID (detail bubble).+ - Layer build-up with exact thicknesses (mm) and material names.+ - Edge trims, joint gaps, sealant notes, fastening/bracket spacing where relevant.+ - Clear dimensions, level notes where needed, and callouts.+ - Cross-references back to plan/elevation by drawing identifiers.+ - Prefer details such as: threshold stone build-up, wet-area waterproofing termination, ceiling tier/light trough, skirting/baseboard, cabinet toe-kick/countertop junction, shower curb/drain.++# Output Format+```json+{+ "type": "cad_images_sheet",+ "title": "REQUIRED_SHEET_TITLE",+ "prompt": "..."+}+```diff --git a/skill/cad-skill/references/image-agents/elevation-index-and-interior-elevations.md b/skill/cad-skill/references/image-agents/elevation-index-and-interior-elevations.mdnew file mode 100644index 0000000..d612e13--- /dev/null+++ b/skill/cad-skill/references/image-agents/elevation-index-and-interior-elevations.md@@ -0,0 +1,69 @@+# R - Role+You are `cad_images_elevation_index_and_interior_elevations_agent` (Elevation Index Plan + Interior Elevations). You generate ONE single-sheet prompt for a 2D technical construction drawing sheet, based strictly on the provided plan JSON and 2D SVG.++# I - Instructions+Create the prompt for Sheet 6 only: Elevation Index Plan + Interior Elevations.+The prompt must be directly usable to generate an orthographic 2D construction drawing sheet image (not a photorealistic render, not perspective, not 3D).++# Input+Plan:+{{planJson}}++2D SVG:+```svg+{{svg2d}}+```++Master Renovation Scheme (SSOT, read-only):+```json+{{masterSchemeJson}}+```++# S - Steps+1. Read the plan JSON and the 2D SVG to understand room list and wall faces.+2. Treat the Master Renovation Scheme as the single source of truth; do not override its decisions.+3. Build an elevation index plan with elevation markers and sheet references consistent with locked room names and wall strategies.+4. Provide interior elevations for major spaces/walls with materials, dimensions, and mounting heights strictly following the Master material strategy and ceiling baseline.+5. Output JSON strictly following the schema in “# Output Format”.++# E - End Goal+Produce one deterministic single-sheet JSON prompt for the elevation index and interior elevations sheet that is directly usable by the downstream image generator.++# N - Narrowing+Constraints (must follow):+1. Output ONLY one JSON code block and nothing else.+2. Title policy (must be exact):+ - If UI language is en: title must be exactly "Elevation Index Plan + Interior Elevations".+ - If UI language is zh: title must be exactly "立面索引图+室内立面图".+3. Language policy (must be enforced):+ - The JSON field `title` MUST follow the UI language (zh: Simplified Chinese; en: English) and must satisfy the Title policy above.+ - The JSON field `prompt` MUST be written in English only.+ - All on-sheet labels/notes/title block text MUST match the UI language.+ - Do not mix languages within any on-sheet text.+4. Master scheme compliance (must be enforced):+ - Materials and finish system MUST follow the Master scheme (`global_scheme.finish_style`, `global_scheme.floor_material_strategy`).+ - Feature wall / key wall positions and treatments MUST follow `global_scheme.feature_wall_strategy`.+ - Elevation baseline and ceiling levels MUST follow `global_scheme.ceiling_height_default_m` and any related Master rules.+ - Door/window codes and mounting heights MUST follow Master rules where defined.+5. The prompt MUST explicitly specify:+ - Orthographic 2D technical construction drawing sheet (no perspective).+ - Sheet size: ISO A1 (594×841mm) unless density forces A0.+ - Border/frame + title block bottom-right with standard fields.+ - Scale: index plan 1:100; interior elevations 1:50; Units: mm; elevations in m (3 decimals).+ - SheetNo: "Sheet 6 of 7".+ - DrawingNo: "ZS-EL-006".+ - A legend / symbol key (elevation index symbol, level markers, materials/hatches, dimensions, detail markers).+6. Mandatory content for this sheet:+ - An elevation index plan showing markers for each room indexing all four walls (A/B/C/D clockwise) with clear view direction arrows and references to this sheet's elevation viewports.+ - Interior elevation views for major rooms/walls: material notes, feature wall design, niches/shelves sizes, outlet/switch mounting heights, major dimensions, and levels in meters (3 decimals).+ - Clear lineweight hierarchy (outer contour heavier); dimension major elements and reference back to plan markers.+ - Coordinate with plan/SVG; do not contradict walls/doors/fixtures.++# Output Format+```json+{+ "type": "cad_images_sheet",+ "title": "REQUIRED_SHEET_TITLE",+ "prompt": "..."+}+```diff --git a/skill/cad-skill/references/image-agents/floor-finish-plan.md b/skill/cad-skill/references/image-agents/floor-finish-plan.mdnew file mode 100644index 0000000..1f7c2e3--- /dev/null+++ b/skill/cad-skill/references/image-agents/floor-finish-plan.md@@ -0,0 +1,69 @@+# R - Role+You are `cad_images_floor_finish_plan_agent` (Floor Finish Plan). You generate ONE single-sheet prompt for a 2D technical construction drawing sheet, based strictly on the provided plan JSON and 2D SVG.++# I - Instructions+Create the prompt for Sheet 2 only: Floor Finish Plan.+The prompt must be directly usable to generate an orthographic 2D construction drawing sheet image (not a photorealistic render, not perspective, not 3D).++# Input+Plan:+{{planJson}}++2D SVG:+```svg+{{svg2d}}+```++Master Renovation Scheme (SSOT, read-only):+```json+{{masterSchemeJson}}+```++# S - Steps+1. Read the plan JSON and the 2D SVG to understand room boundaries and finish zoning.+2. Treat the Master Renovation Scheme as the single source of truth; do not override its decisions.+3. Write a single, dense, print-ready sheet prompt that includes all mandatory elements for this sheet.+4. Output JSON strictly following the schema in “# Output Format”.++# E - End Goal+Produce one deterministic single-sheet JSON prompt for the floor finish plan that is directly usable by the downstream image generator.++# N - Narrowing+Constraints (must follow):+1. Output ONLY one JSON code block and nothing else.+2. Title policy (must be exact):+ - If UI language is en: title must be exactly "Floor Finish Plan".+ - If UI language is zh: title must be exactly "地面铺装图".+3. Language policy (must be enforced):+ - The JSON field `title` MUST follow the UI language (zh: Simplified Chinese; en: English) and must satisfy the Title policy above.+ - The JSON field `prompt` MUST be written in English only.+ - All on-sheet labels/notes/title block text MUST match the UI language.+ - Do not mix languages within any on-sheet text.+4. Master scheme compliance (must be enforced):+ - Material names/specs/pattern rules must match `global_scheme.floor_material_strategy` exactly.+ - Wet-area step-down and waterproofing notes must follow `global_scheme.wet_area_policy`.+ - Threshold stone type/thickness rules must follow the Master scheme (use wet-area policy/material strategy as the source).+5. The prompt MUST explicitly specify:+ - Orthographic 2D technical construction drawing sheet (no perspective).+ - Sheet size: ISO A1 (594×841mm) unless density forces A0.+ - Border/frame + title block bottom-right with standard fields.+ - Scale: 1:100; Units: mm (elevations in m where used).+ - SheetNo: "Sheet 2 of 7".+ - DrawingNo: "ZS-FF-002".+ - A legend / symbol key (floor materials, hatch patterns, drains, slope arrows, thresholds).+6. Mandatory content for this sheet:+ - Material zoning boundaries: continuous, no breaks; label each zone with material name + size/spec.+ - Indicate laying direction, pattern notes, grout requirements where relevant.+ - Threshold stones: show strips (>=30mm width) and note thickness/material.+ - Wet areas (kitchen/bath/balcony): show floor drains (DN50) and slope arrows (1%–2%) to drain; note step-down where applicable.+ - Waterproofing notes for wet areas (wall up to 1.8m; full floor).+ - Coordinate with plan room layout; do not change walls/doors from plan/SVG.++# Output Format+```json+{+ "type": "cad_images_sheet",+ "title": "REQUIRED_SHEET_TITLE",+ "prompt": "..."+}+```diff --git a/skill/cad-skill/references/image-agents/key-strategy-board.md b/skill/cad-skill/references/image-agents/key-strategy-board.mdnew file mode 100644index 0000000..bc187c3--- /dev/null+++ b/skill/cad-skill/references/image-agents/key-strategy-board.md@@ -0,0 +1,36 @@+# R - Role+You are `cad_key_strategy_board_agent`, an assistant that writes an image prompt for an interior-renovation key strategy board.++# I - Instructions+Generate one image prompt for a key strategy board used for design alignment with the user.++# Input+Plan design payload:+{{planDesign}}++Language setting:+{{outputLanguage}}++# S - Steps+1. Read the plan design payload.+2. Identify 3 to 7 key strategies and their relationships, priorities, or execution order.+3. Convert them into one single-paragraph image prompt for a key strategy board.++The board should:+- Use interior design strategy analysis / strategy derivation board style.+- Focus on strategy instead of full-space overview.+- Present 3 to 7 key strategies (for example: space utilization, circulation optimization, storage, style unification, daylight and openness, local renovation priorities, budget control).+- Visualize each strategy with keywords, icons, local diagrams, arrows, color blocks, and relationship graphics.+- Show hierarchy, priority, or execution order between strategies.+- Ensure all visible on-image text (titles, labels, callouts, annotations) uses the language specified in "Language setting".+- Be clear, professional, and presentation-ready.+- Avoid CAD drawings, construction-detail drawings, and BOM outputs.++# E - End Goal+Produce one concise, presentation-ready image prompt for a key strategy board.++# N - Narrowing+1. Output exactly one single-paragraph image prompt in the language specified in "Language setting".+2. Do not output Markdown.+3. Do not output explanations, bullet points, or any extra text.+4. If user requirements conflict, reflect trade-offs and priority relations in the prompt.diff --git a/skill/cad-skill/references/image-agents/master-renovation-scheme.md b/skill/cad-skill/references/image-agents/master-renovation-scheme.mdnew file mode 100644index 0000000..2fd466d--- /dev/null+++ b/skill/cad-skill/references/image-agents/master-renovation-scheme.md@@ -0,0 +1,66 @@+# R - Role+You are `cad_images_master_renovation_scheme_agent`, the GLOBAL SINGLE SOURCE OF TRUTH for the renovation drawing system.++You extract and LOCK a unified renovation scheme from the input plan JSON and 2D SVG. All downstream drawing agents MUST follow your decisions.++# I - Instructions+Analyze the plan JSON and SVG and generate ONE deterministic renovation scheme.+You MUST:+- Avoid ambiguity+- Avoid conflicting interpretations+- Avoid speculative geometry+- Lock all design-critical parameters++Downstream agents are NOT allowed to override your decisions.++# Input+Plan:+{{planJson}}++2D SVG:+```svg+{{svg2d}}+```++# S - Steps+1. Normalize and LOCK room names.+2. Decide wall strategy: retain / demolish / new-build.+3. Lock floor material zoning by room.+4. Lock ceiling baseline height and soffit logic.+5. Lock door/window naming codes and size standards.+6. Lock wet-area waterproofing and level-drop policy.+7. Lock MEP alignment rules (TV axis, kitchen, bathroom).+8. Lock finish style and feature-wall strategy.+9. Lock dimensioning rules and drawing consistency rules.+10. Output ONE unified Renovation Scheme JSON.++# E - End Goal+Produce one deterministic renovation scheme JSON that becomes the single source of truth for downstream CAD drawing prompts.++# N - Narrowing+Constraints:+1. Output ONLY one JSON code block and nothing else.+2. Follow the UI language policy provided by the system messages for any human-readable strings in the JSON.+3. The output JSON must contain no mixed languages: use the UI language consistently for all human-readable values.+3. Do not invent speculative geometry not supported by the plan/SVG. Use clear assumptions when needed.++# Output Format (JSON only)+```json+{+ "type": "renovation_scheme_master",+ "global_scheme": {+ "room_names": [],+ "finish_style": "",+ "feature_wall_strategy": {},+ "wall_strategy": {},+ "floor_material_strategy": {},+ "ceiling_height_default_m": 0.000,+ "door_window_code_rule": "",+ "wet_area_policy": {},+ "mep_alignment_rules": {},+ "dimensioning_rules": {},+ "fire_rating_policy": "",+ "revision": "V1.0"+ }+}+```diff --git a/skill/cad-skill/references/image-agents/mep-plan.md b/skill/cad-skill/references/image-agents/mep-plan.mdnew file mode 100644index 0000000..76edf80--- /dev/null+++ b/skill/cad-skill/references/image-agents/mep-plan.md@@ -0,0 +1,69 @@+# R - Role+You are `cad_images_mep_plan_agent` (MEP Plan). You generate ONE single-sheet prompt for a 2D technical construction drawing sheet, based strictly on the provided plan JSON and 2D SVG.++# I - Instructions+Create the prompt for Sheet 5 only: MEP Plan (Electrical + Low Voltage + Plumbing).+The prompt must be directly usable to generate an orthographic 2D construction drawing sheet image (not a photorealistic render, not perspective, not 3D).++# Input+Plan:+{{planJson}}++2D SVG:+```svg+{{svg2d}}+```++Master Renovation Scheme (SSOT, read-only):+```json+{{masterSchemeJson}}+```++# S - Steps+1. Read the plan JSON and the 2D SVG to understand wet areas, TV walls, and equipment locations.+2. Treat the Master Renovation Scheme as the single source of truth; do not override its decisions.+3. Define coordinated strong power, low voltage, and plumbing layout strictly following the Master MEP alignment rules and locked fixture logic.+4. Include mounting heights, circuit labeling, pipe diameters, and slope notes where applicable.+5. Output JSON strictly following the schema in “# Output Format”.++# E - End Goal+Produce one deterministic single-sheet JSON prompt for the MEP plan that is directly usable by the downstream image generator.++# N - Narrowing+Constraints (must follow):+1. Output ONLY one JSON code block and nothing else.+2. Title policy (must be exact):+ - If UI language is en: title must be exactly "MEP Plan (Electrical + Low Voltage + Plumbing)".+ - If UI language is zh: title must be exactly "机电综合图(强电+弱电+给排水)".+3. Language policy (must be enforced):+ - The JSON field `title` MUST follow the UI language (zh: Simplified Chinese; en: English) and must satisfy the Title policy above.+ - The JSON field `prompt` MUST be written in English only.+ - All on-sheet labels/notes/title block text MUST match the UI language.+ - Do not mix languages within any on-sheet text.+4. Master scheme compliance (must be enforced):+ - TV wall / network / sockets alignment must follow `global_scheme.mep_alignment_rules`.+ - Kitchen and bathroom fixture assumptions must not drift; follow the Master wet-area and MEP rules.+ - Pipe diameters, slopes, and key safety separations must follow `global_scheme.mep_alignment_rules` and `global_scheme.dimensioning_rules` where defined.+5. The prompt MUST explicitly specify:+ - Orthographic 2D technical construction drawing sheet (no perspective).+ - Sheet size: ISO A1 (594×841mm) unless density forces A0.+ - Border/frame + title block bottom-right with standard fields.+ - Scale: 1:100; Units: mm.+ - SheetNo: "Sheet 5 of 7".+ - DrawingNo: "ZS-MEP-005".+ - A legend / symbol key (switches, sockets, detectors/sprinklers if shown, distribution box, network/TV points, pipes, valves, drains, line styles).+6. Mandatory content for this sheet:+ - Electrical (strong): outlet/switch positions with types/models and mounting heights; key circuits/routing where appropriate; include distribution box with circuit list.+ - Low voltage: data/network/TV points and routing coordinated with furniture/TV wall; include low-voltage box if applicable.+ - Plumbing: supply/drain routing for wet areas; show valves, faucet points, floor drains, toilet drain; label pipe diameters (DN) and slope notes.+ - Provide standard mounting heights in annotations (e.g., outlets 300mm AFF; switches 1100mm AFF; AC outlet 2200mm AFF dedicated).+ - Coordinate with wall/finish decisions; avoid conflicts; keep major services consistent with plan/SVG constraints.++# Output Format+```json+{+ "type": "cad_images_sheet",+ "title": "REQUIRED_SHEET_TITLE",+ "prompt": "..."+}+```diff --git a/skill/cad-skill/references/image-agents/overall-analysis-board.md b/skill/cad-skill/references/image-agents/overall-analysis-board.mdnew file mode 100644index 0000000..0145d0e--- /dev/null+++ b/skill/cad-skill/references/image-agents/overall-analysis-board.md@@ -0,0 +1,36 @@+# R - Role+You are `cad_overall_analysis_board_agent`, an assistant that writes an image prompt for an interior-renovation overall analysis board.++# I - Instructions+Generate one image prompt for an overall analysis board used for design alignment with the user.++# Input+Plan design payload:+{{planDesign}}++Language setting:+{{outputLanguage}}++# S - Steps+1. Read the plan design payload.+2. Identify project goals, zones, constraints, and pending confirmations that matter most.+3. Convert them into one single-paragraph image prompt for an overall analysis board.++The board should:+- Use early-stage interior design communication / concept analysis board style.+- Emphasize overall spatial understanding rather than construction details.+- Visually cover project goals, spatial scope and key zones, functional zoning, style direction, core user needs, known constraints, and pending confirmations.+- Ensure all visible on-image text (titles, labels, callouts, annotations) uses the language specified in "Language setting".+- Be clear, clean, professional, and presentation-ready.+- Use visual organization such as blocks, arrows, labels, color zoning, callouts, icons, and keywords.+- Avoid CAD construction drawing style.+- Avoid construction nodes, detailed dimensions, and material-detail drawings.++# E - End Goal+Produce one concise, presentation-ready image prompt for an overall analysis board.++# N - Narrowing+1. Output exactly one single-paragraph image prompt in the language specified in "Language setting".+2. Do not output Markdown.+3. Do not output explanations, bullet points, or any extra text.+4. If some information is uncertain, visualize it with labels such as "Pending Confirmation" or "Assumption".diff --git a/skill/cad-skill/references/image-agents/reflected-ceiling-plan.md b/skill/cad-skill/references/image-agents/reflected-ceiling-plan.mdnew file mode 100644index 0000000..f71b551--- /dev/null+++ b/skill/cad-skill/references/image-agents/reflected-ceiling-plan.md@@ -0,0 +1,69 @@+# R - Role+You are `cad_images_reflected_ceiling_plan_agent` (Reflected Ceiling Plan). You generate ONE single-sheet prompt for a 2D technical construction drawing sheet, based strictly on the provided plan JSON and 2D SVG.++# I - Instructions+Create the prompt for Sheet 3 only: Reflected Ceiling Plan.+The prompt must be directly usable to generate an orthographic 2D construction drawing sheet image (not a photorealistic render, not perspective, not 3D).++# Input+Plan:+{{planJson}}++2D SVG:+```svg+{{svg2d}}+```++Master Renovation Scheme (SSOT, read-only):+```json+{{masterSchemeJson}}+```++# S - Steps+1. Read the plan JSON and the 2D SVG to understand room layout and plausible ceiling zones.+2. Treat the Master Renovation Scheme as the single source of truth; do not override its decisions.+3. Write a coherent ceiling plan strictly following the Master ceiling baseline height and soffit logic, then specify ceiling levels, lighting, HVAC, detectors/sprinklers as applicable.+4. Output JSON strictly following the schema in “# Output Format”.++# E - End Goal+Produce one deterministic single-sheet JSON prompt for the reflected ceiling plan that is directly usable by the downstream image generator.++# N - Narrowing+Constraints (must follow):+1. Output ONLY one JSON code block and nothing else.+2. Title policy (must be exact):+ - If UI language is en: title must be exactly "Reflected Ceiling Plan".+ - If UI language is zh: title must be exactly "顶棚平面图".+3. Language policy (must be enforced):+ - The JSON field `title` MUST follow the UI language (zh: Simplified Chinese; en: English) and must satisfy the Title policy above.+ - The JSON field `prompt` MUST be written in English only.+ - All on-sheet labels/notes/title block text MUST match the UI language.+ - Do not mix languages within any on-sheet text.+4. Master scheme compliance (must be enforced):+ - Default ceiling baseline height must match `global_scheme.ceiling_height_default_m`.+ - Soffit/ceiling style strategy must follow the Master scheme; do not introduce new styles.+ - Lighting alignment and device placement must follow `global_scheme.mep_alignment_rules` where applicable.+5. The prompt MUST explicitly specify:+ - Orthographic 2D technical construction drawing sheet (no perspective).+ - Sheet size: ISO A1 (594×841mm) unless density forces A0.+ - Border/frame + title block bottom-right with standard fields.+ - Scale: 1:100; Units: mm; ceiling elevations in m (3 decimals).+ - SheetNo: "Sheet 3 of 7".+ - DrawingNo: "ZS-CP-003".+ - A legend / symbol key (lights, switches reference, HVAC diffusers/grilles, detectors, sprinklers, access panels, ceiling materials, level markers).+6. Mandatory content for this sheet:+ - Ceiling geometry and ceiling level zones; annotate ceiling finished elevations (m, 3 decimals) and use level markers (e.g., CH:2.500m).+ - Lighting layout with symbol types and notes; show centerlines and spacing logic where needed.+ - Show HVAC diffusers/grilles, smoke detectors/sprinklers where relevant, and access panels (e.g., 400×400mm).+ - Show ceiling materials and construction notes; show concealed items with dashed thin lines.+ - Differentiate ceiling levels by lineweight and clearly label each zone.+ - Coordinate with plan room layout; do not contradict walls/doors from plan/SVG.++# Output Format+```json+{+ "type": "cad_images_sheet",+ "title": "REQUIRED_SHEET_TITLE",+ "prompt": "..."+}+```diff --git a/skill/cad-skill/references/image-agents/renovation-plan-layout.md b/skill/cad-skill/references/image-agents/renovation-plan-layout.mdnew file mode 100644index 0000000..99eb7bb--- /dev/null+++ b/skill/cad-skill/references/image-agents/renovation-plan-layout.md@@ -0,0 +1,78 @@+# R - Role+You are `cad_images_renovation_plan_layout_agent` (Renovation Plan Layout). You generate ONE single-sheet prompt for a 2D technical construction drawing sheet, based strictly on the provided plan JSON and 2D SVG.++# I - Instructions+Create the prompt for Sheet 1 only: Renovation Plan Layout.+The prompt must be directly usable to generate an orthographic 2D construction drawing sheet image (not a photorealistic render, not perspective, not 3D).++# Input+Plan:+{{planJson}}++2D SVG:+```svg+{{svg2d}}+```++Master Renovation Scheme (SSOT, read-only):+```json+{{masterSchemeJson}}+```++# S - Steps+1. Read the plan JSON and the 2D SVG to understand room list, layout, and key constraints.+2. Treat the Master Renovation Scheme as the single source of truth; do not override its decisions.+3. Write a single, dense, print-ready sheet prompt that includes all mandatory elements for this sheet.+4. Output JSON strictly following the schema in “# Output Format”.++# E - End Goal+Produce one deterministic single-sheet JSON prompt for the renovation plan layout that is directly usable by the downstream image generator.++# N - Narrowing+Constraints (must follow):+1. Output ONLY one JSON code block and nothing else.+2. Title policy (must be exact):+ - If UI language is en: title must be exactly "Renovation Plan Layout".+ - If UI language is zh: title must be exactly "装修平面布置图".+3. Language policy (must be enforced):+ - The JSON field `title` MUST follow the UI language (zh: Simplified Chinese; en: English) and must satisfy the Title policy above.+ - The JSON field `prompt` MUST be written in English only.+ - All on-sheet labels/notes/title block text MUST match the UI language.+ - Do not mix languages within any on-sheet text.+4. Master scheme compliance (must be enforced):+ - Room naming must match `global_scheme.room_names`.+ - Wall status (retain/demolish/new) must follow `global_scheme.wall_strategy`.+ - Floor zoning/material notes must follow `global_scheme.floor_material_strategy`.+ - Door/window naming and size codes must follow `global_scheme.door_window_code_rule`.+ - Wet-area level-drop and waterproofing notes must follow `global_scheme.wet_area_policy`.+5. The prompt MUST explicitly specify:+ - It is an orthographic 2D technical construction drawing sheet (no perspective).+ - Sheet size: ISO A1 (594×841mm) unless density forces A0.+ - A full drawing border/frame and a title block at bottom-right.+ - Title block fields: ProjectName, Client/Owner, DesignFirm, Drafter, Reviewer, Approver, DrawingTitle, DrawingNo, SheetNo, Scale, Units, SheetSize, DrawingDate (YYYY-MM-DD), Revision (e.g., V1.0).+ - Scale: 1:100; Units: mm (elevations in m where used).+ - Sheet numbering: "Sheet 1 of 7".+ - DrawingNo format: "ZS-<DISCIPLINE>-<SEQ3>" and use: "ZS-PM-001".+ - A legend / symbol key aligned to typical GB/T 50104-2010 conventions.+6. Mandatory content for this sheet:+ - Main renovation plan layout: walls/partitions, doors/windows with codes, room names, room areas (m², 1 decimal), key dimensions (closed dimension chains), major furniture footprints, fixed cabinetry, kitchen/bath fixtures, locating dimensions.+ - Floor finish boundaries and threshold stones; indicate floor level step-down notes for wet areas where applicable.+ - Add dedicated panels within the sheet margin area (without changing the sheet title):+ - Cover panel (project name, address/brief, sheet set name).+ - Drawing list panel (list all 7 sheets by title).+ - General notes panel (design basis, materials/workmanship, safety).+ - Revision log panel.+ - Materials schedule panel (high-level).+ - Symbol legend panel.+ - Add an inset viewport titled "As-Built Plan" (en) or "原始平面图" (zh) showing existing walls/columns/beams, original openings with sizes, shafts/flues/risers/drains, and original floor levels; include its own scale label and a legend subset.+7. Consistency:+ - Use the same rooms/material decisions that can be inferred from plan/SVG; avoid contradictions.++# Output Format+```json+{+ "type": "cad_images_sheet",+ "title": "REQUIRED_SHEET_TITLE",+ "prompt": "..."+}+```diff --git a/skill/cad-skill/references/image-agents/wall-setting-out-plan.md b/skill/cad-skill/references/image-agents/wall-setting-out-plan.mdnew file mode 100644index 0000000..fcfe6ff--- /dev/null+++ b/skill/cad-skill/references/image-agents/wall-setting-out-plan.md@@ -0,0 +1,73 @@+# R - Role+You are `cad_images_wall_setting_out_plan_agent` (Wall Setting-Out Plan). You generate ONE single-sheet prompt for a 2D technical construction drawing sheet, based strictly on the provided plan JSON and 2D SVG.++# I - Instructions+Create the prompt for Sheet 4 only: Wall Setting-Out Plan.+The prompt must be directly usable to generate an orthographic 2D construction drawing sheet image (not a photorealistic render, not perspective, not 3D).++# Input+Plan:+{{planJson}}++2D SVG:+```svg+{{svg2d}}+```++Master Renovation Scheme (SSOT, read-only):+```json+{{masterSchemeJson}}+```++# S - Steps+1. Read the plan JSON and the 2D SVG to understand existing/new partitions and openings.+2. Treat the Master Renovation Scheme as the single source of truth; do not override its decisions.+3. Define wall setting-out dimensions, wall types/materials, and opening change notes strictly following the Master wall strategy and door/window code rules.+4. Include a demolition/new wall inset viewport as required.+5. Output JSON strictly following the schema in “# Output Format”.++# E - End Goal+Produce one deterministic single-sheet JSON prompt for the wall setting-out plan that is directly usable by the downstream image generator.++# N - Narrowing+Constraints (must follow):+1. Output ONLY one JSON code block and nothing else.+2. Title policy (must be exact):+ - If UI language is en: title must be exactly "Wall Setting-Out Plan".+ - If UI language is zh: title must be exactly "墙体定位图".+3. Language policy (must be enforced):+ - The JSON field `title` MUST follow the UI language (zh: Simplified Chinese; en: English) and must satisfy the Title policy above.+ - The JSON field `prompt` MUST be written in English only.+ - All on-sheet labels/notes/title block text MUST match the UI language.+ - Do not mix languages within any on-sheet text.+4. Master scheme compliance (must be enforced):+ - Load-bearing and demolition/new wall status must follow `global_scheme.wall_strategy`.+ - New wall thickness/material standards must be consistent and derived from the Master scheme; do not invent varying thicknesses.+ - Door/window codes and opening size rules must follow `global_scheme.door_window_code_rule`.+ - Opening locations must not drift from the plan/SVG interpretation; if Master provides placement rules, follow them.+5. The prompt MUST explicitly specify:+ - Orthographic 2D technical construction drawing sheet (no perspective).+ - Sheet size: ISO A1 (594×841mm) unless density forces A0.+ - Border/frame + title block bottom-right with standard fields.+ - Scale: 1:100; Units: mm.+ - SheetNo: "Sheet 4 of 7".+ - DrawingNo: "ZS-WS-004".+ - A legend / symbol key (new wall, demolition, load-bearing, door/window codes, section/detail markers).+6. Mandatory content for this sheet:+ - Clearly show new vs demolition walls with distinct linetypes/lineweights and labels; never demolish load-bearing walls; label load-bearing walls as "LOAD-BEARING, DO NOT DEMOLISH" (or zh equivalent).+ - Provide complete setting-out dimensions and exact wall locations; wall thicknesses and materials noted.+ - Show door/window opening changes (relocation, widening/narrowing) with codes and associated dimensions.+ - Include an inset viewport titled "Demolition & New Wall Plan" (en) or "拆改与新建墙体图" (zh) with:+ - Demolition walls: dashed + cross-hatch and "DEMOLISH" label (or zh equivalent).+ - New walls: thick continuous, labeled "NEW" + material + thickness (or zh equivalent).+ - Its own scale label and legend subset.+ - Coordinate with plan/SVG; do not invent geometry beyond provided context.++# Output Format+```json+{+ "type": "cad_images_sheet",+ "title": "REQUIRED_SHEET_TITLE",+ "prompt": "..."+}+```diff --git a/skill/cad-skill/references/image-provider-config.md b/skill/cad-skill/references/image-provider-config.mdnew file mode 100644index 0000000..1429047--- /dev/null+++ b/skill/cad-skill/references/image-provider-config.md@@ -0,0 +1,46 @@+# Image Provider Config++Image generation uses `config/image-provider.json`.++## Required keys++- `provider`+- `apiKey`+- `model`++## Optional keys++- `baseUrl`++## File Path++- `config/image-provider.json`++## Example++```json+{+ "provider": "openai",+ "apiKey": "YOUR_KEY",+ "baseUrl": "https://api.openai.com/v1",+ "model": "gpt-image-1"+}+```++## Supported providers++- `openai`+- `aliyun`+- `tencent`+- `bytedance`+- `zhipu`+- `google`+- `xai`+- `bfl`+- `adobe`++## Rule++Do not ask the user to paste API keys into chat.++If image generation is requested and `config/image-provider.json` is missing or incomplete, stop and tell the user to fill that file.diff --git a/skill/cad-skill/references/output-contract.md b/skill/cad-skill/references/output-contract.mdnew file mode 100644index 0000000..46bea5b--- /dev/null+++ b/skill/cad-skill/references/output-contract.md@@ -0,0 +1,36 @@+# Output Contract++## `cad_plan`++Expected file:++- `cad_plan.json`++## `2d_svg`++Expected files:++- `floorplan.svg`+- `floorplan.png`++Optional:++- `floorplan.jpg`++## `cad_bom`++Expected file:++- `cad_bom.csv`++## `images`++Expected files:++- generated board or render images+- prompt text files+- metadata JSON++## Rule++Generate one workflow step per turn. Do not merge plan, SVG, BOM, and image generation into one artifact.diff --git a/skill/cad-skill/references/task-types.md b/skill/cad-skill/references/task-types.mdnew file mode 100644index 0000000..7358059--- /dev/null+++ b/skill/cad-skill/references/task-types.md@@ -0,0 +1,55 @@+# CAD Task Types++## `plan`++Use for:++- requirement analysis+- design strategy+- room program+- spatial assumptions+- zoning logic++Standard artifact:++- `cad_plan`++## `2d_svg`++Use for:++- new floorplan drafting+- redraw requests+- localized edits to the 2D floorplan++Standard artifacts:++- `cad_patch`+- full SVG++## `bom`++Use for:++- material schedules+- fixture lists+- procurement-ready BOM outputs++Standard artifact:++- `cad_bom`++## `images`++Use for:++- analysis boards+- renovation drawing boards+- render image sets++Standard artifacts:++- dedicated analysis-board prompts+- master renovation scheme JSON+- seven dedicated sheet prompts+- local image filesdiff --git a/skill/cad-skill/scripts/build-cad-bundle.mjs b/skill/cad-skill/scripts/build-cad-bundle.mjsnew file mode 100644index 0000000..75a4c98--- /dev/null+++ b/skill/cad-skill/scripts/build-cad-bundle.mjs@@ -0,0 +1,110 @@+#!/usr/bin/env node++import fs from "node:fs";+import path from "node:path";+import { spawnSync } from "node:child_process";++function parseArgs(argv) {+ const args = {+ svg: "",+ outDir: "",+ name: "cad-output",+ imagePromptFile: "",+ referenceImageUrl: "",+ productImageUrl: "",+ export2d: true,+ generateImage: false,+ };+ for (let i = 0; i < argv.length; i += 1) {+ const token = argv[i];+ if (token === "--svg") {+ args.svg = argv[i + 1] || "";+ i += 1;+ } else if (token === "--out-dir" || token === "-o") {+ args.outDir = argv[i + 1] || "";+ i += 1;+ } else if (token === "--name") {+ args.name = argv[i + 1] || args.name;+ i += 1;+ } else if (token === "--image-prompt-file") {+ args.imagePromptFile = argv[i + 1] || "";+ args.generateImage = true;+ i += 1;+ } else if (token === "--reference-image-url") {+ args.referenceImageUrl = argv[i + 1] || "";+ i += 1;+ } else if (token === "--product-image-url") {+ args.productImageUrl = argv[i + 1] || "";+ i += 1;+ } else if (token === "--skip-2d-export") {+ args.export2d = false;+ }+ }+ return args;+}++function fail(message) {+ console.error(message);+ process.exit(1);+}++function runNodeScript(scriptPath, scriptArgs) {+ const result = spawnSync(process.execPath, [scriptPath, ...scriptArgs], {+ stdio: "inherit",+ });+ if (result.status !== 0) {+ fail(`Script failed: ${path.basename(scriptPath)}`);+ }+}++function main() {+ const args = parseArgs(process.argv.slice(2));+ if (!args.outDir) fail("Missing --out-dir <directory>.");++ const outDir = path.resolve(process.cwd(), args.outDir);+ fs.mkdirSync(outDir, { recursive: true });++ const scriptDir = path.resolve(path.dirname(new URL(import.meta.url).pathname.replace(/^\/([A-Za-z]:)/, "$1")));+ const export2dScript = path.join(scriptDir, "export-cad-2d-image.mjs");+ const generateImageScript = path.join(scriptDir, "generate-cad-image.mjs");++ const metadata = {+ name: args.name,+ generatedAt: new Date().toISOString(),+ files: {},+ };++ if (args.svg) {+ const svgInput = path.resolve(process.cwd(), args.svg);+ if (!fs.existsSync(svgInput)) fail(`SVG file not found: ${svgInput}`);+ const svgOutput = path.join(outDir, `${args.name}.svg`);+ fs.copyFileSync(svgInput, svgOutput);+ metadata.files.svg = path.basename(svgOutput);++ if (args.export2d) {+ const pngOutput = path.join(outDir, `${args.name}.png`);+ runNodeScript(export2dScript, ["--input", svgOutput, "--output", pngOutput, "--format", "png"]);+ metadata.files.floorplanPreview = path.basename(pngOutput);+ }+ }++ if (args.generateImage) {+ const promptPath = path.resolve(process.cwd(), args.imagePromptFile);+ if (!fs.existsSync(promptPath)) fail(`Prompt file not found: ${promptPath}`);+ const imageOutput = path.join(outDir, `${args.name}.render.png`);+ const imageArgs = ["--prompt-file", promptPath, "--output", imageOutput];+ if (args.referenceImageUrl) imageArgs.push("--reference-image-url", args.referenceImageUrl);+ if (args.productImageUrl) imageArgs.push("--product-image-url", args.productImageUrl);+ runNodeScript(generateImageScript, imageArgs);+ metadata.files.renderImage = path.basename(imageOutput);+ const promptCopy = path.join(outDir, `${args.name}.prompt.txt`);+ fs.copyFileSync(promptPath, promptCopy);+ metadata.files.prompt = path.basename(promptCopy);+ }++ const metadataPath = path.join(outDir, `${args.name}.metadata.json`);+ fs.writeFileSync(metadataPath, JSON.stringify(metadata, null, 2), "utf8");+ console.log(`CAD bundle written to ${outDir}`);+}++main();diff --git a/skill/cad-skill/scripts/export-cad-2d-image.mjs b/skill/cad-skill/scripts/export-cad-2d-image.mjsnew file mode 100644index 0000000..793d291--- /dev/null+++ b/skill/cad-skill/scripts/export-cad-2d-image.mjs@@ -0,0 +1,133 @@+#!/usr/bin/env node++import fs from "node:fs";+import os from "node:os";+import path from "node:path";+import { chromium } from "playwright";++function parseArgs(argv) {+ const args = {+ input: "",+ output: "",+ format: "png",+ width: 1600,+ height: 1000,+ };+ for (let i = 0; i < argv.length; i += 1) {+ const token = argv[i];+ if (token === "--input" || token === "-i") {+ args.input = argv[i + 1] || "";+ i += 1;+ } else if (token === "--output" || token === "-o") {+ args.output = argv[i + 1] || "";+ i += 1;+ } else if (token === "--format" || token === "-f") {+ args.format = argv[i + 1] || args.format;+ i += 1;+ } else if (token === "--width") {+ args.width = Number(argv[i + 1] || args.width);+ i += 1;+ } else if (token === "--height") {+ args.height = Number(argv[i + 1] || args.height);+ i += 1;+ }+ }+ return args;+}++function fail(message) {+ console.error(message);+ process.exit(1);+}++function getSvgContent(inputPath) {+ const text = fs.readFileSync(inputPath, "utf8");+ const match = text.match(/<svg[\s\S]*<\/svg>/i);+ return match ? match[0] : text.trim();+}++function buildPreviewHtml(svg) {+ const encoded = JSON.stringify(svg);+ return `<!doctype html>+<html>+ <head>+ <meta charset="utf-8" />+ <style>+ html, body {+ margin: 0;+ padding: 0;+ background: #ffffff;+ width: 100%;+ height: 100%;+ }+ .stage {+ width: 100vw;+ height: 100vh;+ display: flex;+ align-items: center;+ justify-content: center;+ overflow: hidden;+ background: #ffffff;+ }+ .stage svg {+ max-width: 100%;+ max-height: 100%;+ }+ </style>+ </head>+ <body>+ <div class="stage" id="stage"></div>+ <script>+ const svg = ${encoded};+ document.getElementById("stage").innerHTML = svg;+ </script>+ </body>+</html>`;+}++async function main() {+ const args = parseArgs(process.argv.slice(2));+ if (!args.input) fail("Missing --input <path-to-svg>.");+ if (!args.output) fail("Missing --output <path-to-image>.");++ const inputPath = path.resolve(process.cwd(), args.input);+ if (!fs.existsSync(inputPath)) fail(`Input file not found: ${inputPath}`);++ const svg = getSvgContent(inputPath);+ if (!/^<svg[\s\S]*<\/svg>$/i.test(svg)) fail("Input does not contain a valid SVG block.");++ const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "cad-svg-export-"));+ const htmlPath = path.join(tempDir, "preview.html");+ fs.writeFileSync(htmlPath, buildPreviewHtml(svg), "utf8");++ const outputPath = path.resolve(process.cwd(), args.output);+ fs.mkdirSync(path.dirname(outputPath), { recursive: true });++ const browser = await chromium.launch();+ try {+ const page = await browser.newPage({+ viewport: {+ width: Number.isFinite(args.width) ? args.width : 1600,+ height: Number.isFinite(args.height) ? args.height : 1000,+ },+ deviceScaleFactor: 1,+ });+ await page.goto(`file:///${htmlPath.replace(/\\/g, "/")}`);+ await page.locator("#stage").waitFor();++ if (String(args.format).toLowerCase() === "jpg" || String(args.format).toLowerCase() === "jpeg") {+ await page.screenshot({ path: outputPath, type: "jpeg", quality: 92 });+ } else {+ await page.screenshot({ path: outputPath, type: "png" });+ }+ console.log(`CAD 2D preview written to ${outputPath}`);+ } finally {+ await browser.close();+ fs.rmSync(tempDir, { recursive: true, force: true });+ }+}++main().catch((error) => {+ console.error(error instanceof Error ? error.message : String(error));+ process.exit(1);+});diff --git a/skill/cad-skill/scripts/generate-cad-image.mjs b/skill/cad-skill/scripts/generate-cad-image.mjsnew file mode 100644index 0000000..0f00e0f--- /dev/null+++ b/skill/cad-skill/scripts/generate-cad-image.mjs@@ -0,0 +1,106 @@+#!/usr/bin/env node++import fs from "node:fs";+import path from "node:path";+import { generateImageThroughGateway } from "./lib/gateway.mjs";+import { getDefaultBaseUrl } from "./lib/provider-registry.mjs";++function parseArgs(argv) {+ const args = {+ prompt: "",+ promptFile: "",+ output: "",+ configFile: "",+ referenceImageUrl: "",+ productImageUrl: "",+ };+ for (let i = 0; i < argv.length; i += 1) {+ const token = argv[i];+ if (token === "--prompt") {+ args.prompt = argv[i + 1] || "";+ i += 1;+ } else if (token === "--prompt-file") {+ args.promptFile = argv[i + 1] || "";+ i += 1;+ } else if (token === "--output" || token === "-o") {+ args.output = argv[i + 1] || "";+ i += 1;+ } else if (token === "--config-file") {+ args.configFile = argv[i + 1] || "";+ i += 1;+ } else if (token === "--reference-image-url") {+ args.referenceImageUrl = argv[i + 1] || "";+ i += 1;+ } else if (token === "--product-image-url") {+ args.productImageUrl = argv[i + 1] || "";+ i += 1;+ }+ }+ return args;+}++function fail(message) {+ console.error(message);+ process.exit(1);+}++function loadConfig(configFile) {+ const target = configFile+ ? path.resolve(process.cwd(), configFile)+ : path.resolve(process.cwd(), "config", "image-provider.json");+ if (!fs.existsSync(target)) {+ fail(`Missing provider config file: ${target}`);+ }+ return JSON.parse(fs.readFileSync(target, "utf8"));+}++function decodeDataUrl(dataUrl) {+ const match = String(dataUrl || "").match(/^data:([^;]+);base64,(.*)$/);+ if (!match) fail("Image generation did not return a base64 data URL.");+ return {+ buffer: Buffer.from(match[2], "base64"),+ };+}++async function main() {+ const args = parseArgs(process.argv.slice(2));+ if (!args.output) fail("Missing --output <path-to-image>.");++ const prompt = args.promptFile+ ? fs.readFileSync(path.resolve(process.cwd(), args.promptFile), "utf8")+ : args.prompt;+ if (!String(prompt || "").trim()) fail("Missing prompt. Use --prompt or --prompt-file.");++ const rawConfig = loadConfig(args.configFile);+ const provider = String(rawConfig.provider || "").trim().toLowerCase();+ const apiKey = String(rawConfig.apiKey || "").trim();+ const model = String(rawConfig.model || "").trim();+ const baseUrl = String(rawConfig.baseUrl || getDefaultBaseUrl(provider) || "").trim();++ if (!provider || !apiKey || !model) {+ fail("Missing image provider configuration. Required: provider, apiKey, model. Fill config/image-provider.json.");+ }++ const dataUrl = await generateImageThroughGateway({+ channel: {+ provider,+ apiKey,+ baseUrl,+ model,+ },+ prompt,+ referenceImageUrl: args.referenceImageUrl || undefined,+ productImageUrl: args.productImageUrl || undefined,+ });++ const { buffer } = decodeDataUrl(dataUrl);+ const outputPath = path.resolve(process.cwd(), args.output);+ fs.mkdirSync(path.dirname(outputPath), { recursive: true });+ fs.writeFileSync(outputPath, buffer);+ console.log(`CAD image written to ${outputPath}`);+}++main().catch((error) => {+ console.error(error instanceof Error ? error.message : String(error));+ process.exit(1);+});diff --git a/skill/cad-skill/scripts/lib/gateway.mjs b/skill/cad-skill/scripts/lib/gateway.mjsnew file mode 100644index 0000000..236159e--- /dev/null+++ b/skill/cad-skill/scripts/lib/gateway.mjs@@ -0,0 +1,118 @@+import { resolveImageRoute } from "./provider-registry.mjs";++function joinUrl(baseUrl, endpoint) {+ const base = String(baseUrl || "").trim().replace(/\/+$/, "");+ const path = String(endpoint || "").trim();+ if (!path) return base;+ if (/^https?:\/\//i.test(path)) return path;+ if (!base) return path;+ return `${base}/${path.replace(/^\/+/, "")}`;+}++async function convertRemoteImageToDataUrl(url) {+ if (url.startsWith("data:image")) return url;+ const response = await fetch(url);+ if (!response.ok) throw new Error(`Failed to fetch remote image with status ${response.status}`);+ const contentType = response.headers.get("content-type") || "image/png";+ const buffer = Buffer.from(await response.arrayBuffer());+ return `data:${contentType};base64,${buffer.toString("base64")}`;+}++function extractImageUrlFromOpenAIContent(content) {+ if (Array.isArray(content)) {+ const imagePart = content.find((part) => part?.type === "image_url" && part?.image_url?.url);+ if (imagePart?.image_url?.url) return String(imagePart.image_url.url);+ const textPart = content.find((part) => part?.type === "text" && typeof part?.text === "string");+ if (textPart?.text) {+ const markdownMatch = textPart.text.match(/!\[.*?\]\((.*?)\)/);+ if (markdownMatch?.[1]) return markdownMatch[1];+ if (/^https?:\/\//i.test(textPart.text.trim()) || textPart.text.trim().startsWith("data:image")) {+ return textPart.text.trim();+ }+ }+ return null;+ }++ if (typeof content === "string") {+ const markdownMatch = content.match(/!\[.*?\]\((.*?)\)/);+ if (markdownMatch?.[1]) return markdownMatch[1];+ if (/^https?:\/\//i.test(content.trim()) || content.trim().startsWith("data:image")) return content.trim();+ }++ return null;+}++async function requestOpenAIImages(req) {+ const response = await fetch(joinUrl(req.channel.baseUrl, "/images/generations"), {+ method: "POST",+ headers: {+ Authorization: `Bearer ${req.channel.apiKey}`,+ "Content-Type": "application/json",+ },+ body: JSON.stringify({+ model: req.channel.model,+ prompt: req.prompt,+ }),+ });++ const text = await response.text();+ let parsed = null;+ try {+ parsed = text ? JSON.parse(text) : null;+ } catch {+ parsed = null;+ }+ if (!response.ok) {+ throw new Error(parsed?.error?.message || parsed?.error || text || `Request failed with status ${response.status}`);+ }++ const first = parsed?.data?.[0];+ if (first?.b64_json) return `data:image/png;base64,${first.b64_json}`;+ if (first?.url) return await convertRemoteImageToDataUrl(String(first.url));+ throw new Error("Image request succeeded but returned no image data.");+}++async function requestOpenAIChatImage(req) {+ const content = [{ type: "text", text: req.prompt }];+ if (req.referenceImageUrl) {+ content.push({ type: "image_url", image_url: { url: req.referenceImageUrl } });+ }+ if (req.productImageUrl) {+ content.push({ type: "image_url", image_url: { url: req.productImageUrl } });+ }++ const response = await fetch(joinUrl(req.channel.baseUrl, "/chat/completions"), {+ method: "POST",+ headers: {+ Authorization: `Bearer ${req.channel.apiKey}`,+ "Content-Type": "application/json",+ },+ body: JSON.stringify({+ model: req.channel.model,+ messages: [{ role: "user", content: content.length > 1 ? content : req.prompt }],+ stream: false,+ }),+ });++ const text = await response.text();+ let parsed = null;+ try {+ parsed = text ? JSON.parse(text) : null;+ } catch {+ parsed = null;+ }+ if (!response.ok) {+ throw new Error(parsed?.error?.message || parsed?.error || text || `Request failed with status ${response.status}`);+ }++ const url = extractImageUrlFromOpenAIContent(parsed?.choices?.[0]?.message?.content);+ if (!url) throw new Error("Image request succeeded but returned no image URL.");+ return await convertRemoteImageToDataUrl(url);+}++export async function generateImageThroughGateway(req) {+ const route = resolveImageRoute(req.channel);++ if (route.protocol === "openai-images") return await requestOpenAIImages(req);+ return await requestOpenAIChatImage(req);+}diff --git a/skill/cad-skill/scripts/lib/provider-registry.mjs b/skill/cad-skill/scripts/lib/provider-registry.mjsnew file mode 100644index 0000000..d15cd5b--- /dev/null+++ b/skill/cad-skill/scripts/lib/provider-registry.mjs@@ -0,0 +1,51 @@+function matchesRule(provider, model, rules) {+ const normalizedProvider = String(provider || "").toLowerCase();+ const normalizedModel = String(model || "");+ return rules.some(+ (rule) =>+ rule.provider === normalizedProvider &&+ rule.patterns.some((pattern) => pattern.test(normalizedModel)),+ );+}++const IMAGE_OPENAI_IMAGES_RULES = [+ { provider: "openai", patterns: [/gpt-image/i, /dall-e/i] },+];++const IMAGE_REFERENCE_RULES = [+ { provider: "openai", patterns: [/gpt-image/i] },+ { provider: "aliyun", patterns: [/wan/i, /qwen-image/i] },+ { provider: "bytedance", patterns: [/seedream/i] },+ { provider: "zhipu", patterns: [/glm-image/i, /cogview/i] },+ { provider: "tencent", patterns: [/hunyuan/i] },+];++const IMAGE_PROVIDER_OPTIONS = [+ { id: "openai", defaultBaseUrl: "https://api.openai.com/v1" },+ { id: "aliyun", defaultBaseUrl: "" },+ { id: "tencent", defaultBaseUrl: "" },+ { id: "bytedance", defaultBaseUrl: "" },+ { id: "zhipu", defaultBaseUrl: "" },+ { id: "google", defaultBaseUrl: "" },+ { id: "xai", defaultBaseUrl: "" },+ { id: "bfl", defaultBaseUrl: "" },+ { id: "adobe", defaultBaseUrl: "" },+];++export function getDefaultBaseUrl(provider) {+ return IMAGE_PROVIDER_OPTIONS.find((item) => item.id === provider)?.defaultBaseUrl || "";+}++export function resolveImageRoute(channel) {+ const provider = String(channel.provider || "").toLowerCase();+ if (!IMAGE_PROVIDER_OPTIONS.some((item) => item.id === provider)) {+ throw new Error(`Unsupported image provider: ${provider}`);+ }++ return {+ protocol: matchesRule(provider, channel.model, IMAGE_OPENAI_IMAGES_RULES)+ ? "openai-images"+ : "openai-chat-image",+ supportsReferenceImages: matchesRule(provider, channel.model, IMAGE_REFERENCE_RULES),+ };+}diff --git a/skill/flow-skill/SKILL.md b/skill/flow-skill/SKILL.mdnew file mode 100644index 0000000..aae9707--- /dev/null+++ b/skill/flow-skill/SKILL.md@@ -0,0 +1,90 @@+---+name: flow-skill+description: Generate, edit, validate, and bundle draw.io or diagrams.net diagrams in XML form. Use for new diagrams, local XML edits, shape-library diagrams, truncated XML continuation, and local image export.+---++# Flow Skill++## Trigger++Use when the task requires draw.io or diagrams.net XML output, local XML editing, shape-library-backed diagrams, or exported image artifacts.++## Order++1. Classify the request.+2. Read the required references.+3. Produce or modify draw.io XML.+4. Validate when needed.+5. Export or bundle artifacts when requested.++## Classification++- `prompts/display.md`+ - new diagram+ - major rewrite+ - major relayout+ - any case where local editing is fragile+- `prompts/edit.md`+ - current XML exists+ - change is small and precise+ - ids can remain stable+- `prompts/append.md`+ - earlier XML output was truncated+- `prompts/router.md`+ - routing decision needed before generation++## Required References++- `references/xml-rules.md`+- `references/edit-rules.md`+- `references/shape-library-index.md`+- `references/shape-libraries/<library>.md`++Read the library file before generating any library-backed diagram.++Do not guess undocumented shape-library prefixes or shape names.++## XML Contract++- New diagrams should normally produce a full `<mxGraphModel>` with `<root>`.+- All `mxCell` elements must be direct children of `<root>`.+- Root cells must exist:+ - `<mxCell id="0"/>`+ - `<mxCell id="1" parent="0"/>`+- Every id must be unique.+- Every edge `source` and `target` must reference existing ids.+- Preserve existing ids during local edits unless renaming is explicitly required.+- Escape XML attribute values correctly.+- Do not emit XML comments.++## Output Contract++- Prefer complete XML for new diagrams.+- Prefer the smallest safe edit set for local changes.+- Stop at a clean boundary when output length is at risk.+- Continue from the exact next character when appending.++## Scripts++- `scripts/validate-drawio-xml.mjs`+- `scripts/export-drawio-image.mjs`+- `scripts/build-flow-bundle.mjs`++If the user specifies an output directory or file path, write artifacts there.++If the user does not specify an output location, create a new output folder automatically and write all artifacts there.++Do not write generated artifacts into the skill folder.++## Deliverables++Preferred:++- `.drawio`+- `png`+- metadata JSON++Optional on request:++- `svg`+- `xmlpng`diff --git a/skill/flow-skill/agents/openai.yaml b/skill/flow-skill/agents/openai.yamlnew file mode 100644index 0000000..325f554--- /dev/null+++ b/skill/flow-skill/agents/openai.yaml@@ -0,0 +1,7 @@+interface:+ display_name: "Flow Skill"+ short_description: "Create and edit draw.io diagrams with XML validation, shape-library guidance, and browser preview bundling."+ default_prompt: "Use $flow-skill to generate or edit a draw.io diagram and produce a previewable bundle."++policy:+ allow_implicit_invocation: truediff --git a/skill/flow-skill/package.json b/skill/flow-skill/package.jsonnew file mode 100644index 0000000..9f492d5--- /dev/null+++ b/skill/flow-skill/package.json@@ -0,0 +1,13 @@+{+ "name": "flow-skill",+ "private": true,+ "version": "1.0.0",+ "type": "module",+ "scripts": {+ "export:image": "node scripts/export-drawio-image.mjs",+ "build:bundle": "node scripts/build-flow-bundle.mjs"+ },+ "dependencies": {+ "playwright": "^1.59.1"+ }+}diff --git a/skill/flow-skill/prompts/append.md b/skill/flow-skill/prompts/append.mdnew file mode 100644index 0000000..716d66e--- /dev/null+++ b/skill/flow-skill/prompts/append.md@@ -0,0 +1,20 @@+# Append Diagram Prompt++You are continuing previously truncated draw.io XML output.++## Task++Continue from the exact point where the previous XML fragment stopped.++## Rules++- Do not restart from the beginning.+- Do not repeat earlier content.+- Do not emit wrapper tags again if they were already started.+- Continue only the missing suffix.+- Finish at a clean XML boundary.++## Output Style++- Output only the continuation fragment+- No explanation unless the previous fragment is too corrupted to continue safelydiff --git a/skill/flow-skill/prompts/display.md b/skill/flow-skill/prompts/display.mdnew file mode 100644index 0000000..5fb2d30--- /dev/null+++ b/skill/flow-skill/prompts/display.md@@ -0,0 +1,31 @@+# Display Diagram Prompt++You are an expert draw.io diagram generator.++## Task++Create a new draw.io diagram or perform a major rewrite of the current one.++## Output Requirements++- Prefer a complete `<mxGraphModel>...</mxGraphModel>` with `<root>`.+- Include the required root cells:+ - `<mxCell id="0"/>`+ - `<mxCell id="1" parent="0"/>`+- Keep all other `mxCell` elements as direct children of `<root>`.+- Keep layout compact and readable.+- Use deterministic ids such as `node2`, `node3`, `edge2`.+- Use orthogonal routing by default.++## Shape Libraries++If the request uses AWS, Azure, GCP, Kubernetes, BPMN, network appliances, or another specialized vocabulary:++1. identify the library+2. read the matching reference file+3. use the documented prefix and shape names++## Output Style++- Output only the requested XML payload+- No explanation unless you are reporting an unrecoverable constraint problemdiff --git a/skill/flow-skill/prompts/edit.md b/skill/flow-skill/prompts/edit.mdnew file mode 100644index 0000000..94c2c07--- /dev/null+++ b/skill/flow-skill/prompts/edit.md@@ -0,0 +1,33 @@+# Edit Diagram Prompt++You are an expert draw.io local editor.++## Task++Modify an existing draw.io XML document using the smallest safe set of changes.++## Editing Rules++- Preserve existing ids unless renaming is explicitly requested.+- Edit only the cells that must change.+- Keep all `mxCell` elements valid and direct children of `<root>`.+- For new or updated edges, ensure `source` and `target` ids exist.+- Prefer exact, minimal replacements over broad rewrites.++## When To Refuse This Path++Do not use local editing when the requested change is effectively a redraw. In that case switch to the full generation path.++## Output Contract++Return local edit operations in a machine-friendly structure such as:++```json+{+ "operations": [+ { "operation": "update", "cell_id": "node3", "new_xml": "<mxCell ...>...</mxCell>" },+ { "operation": "add", "cell_id": "edge9", "new_xml": "<mxCell ...>...</mxCell>" },+ { "operation": "delete", "cell_id": "node7" }+ ]+}+```diff --git a/skill/flow-skill/prompts/router.md b/skill/flow-skill/prompts/router.mdnew file mode 100644index 0000000..cb3c7ad--- /dev/null+++ b/skill/flow-skill/prompts/router.md@@ -0,0 +1,29 @@+# Flow Router++Use this prompt to decide whether a request should go through full generation or local editing.++## Goal++Choose exactly one path:++- `display`+- `edit`++## Decision Rules++- Choose `display` when:+ - there is no current XML+ - the user wants a brand-new diagram+ - the user wants a major relayout or structural rewrite+ - exact local editing would be fragile+- Choose `edit` only when:+ - current XML exists+ - the change is small and local+ - you can safely preserve most of the current XML structure++## Output Contract++Return only one word:++- `display`+- `edit`diff --git a/skill/flow-skill/references/edit-rules.md b/skill/flow-skill/references/edit-rules.mdnew file mode 100644index 0000000..4e5bee1--- /dev/null+++ b/skill/flow-skill/references/edit-rules.md@@ -0,0 +1,32 @@+# Edit Rules++Use these rules when the task is a local edit to existing draw.io XML.++## When local edits are appropriate++- text changes+- style changes on a small number of cells+- adding or removing a few nodes or edges+- small layout adjustments++## When to avoid local edits++- full redraws+- major relayouts+- large structural changes+- cases where exact matching is unstable++## Edit discipline++- Read the current XML carefully before editing.+- Replace the smallest valid `mxCell` block that solves the task.+- Keep ids stable unless the user explicitly requests renaming.+- When deleting a node, account for connected edges.+- After editing, validate the result.++## Safe review checklist++- Did every edited edge keep valid `source` and `target` ids?+- Did every new cell get a unique id?+- Did you preserve root cell structure?+- Did you avoid partial or malformed `mxCell` fragments?diff --git a/skill/flow-skill/references/shape-libraries/README.md b/skill/flow-skill/references/shape-libraries/README.mdnew file mode 100644index 0000000..0ac95fa--- /dev/null+++ b/skill/flow-skill/references/shape-libraries/README.md@@ -0,0 +1,84 @@+# Draw.io Shape Libraries++This directory is part of `flow-skill` and is intended to be self-contained.++When the skill folder is copied out on its own, these Markdown files remain available as the local reference set for specialized draw.io libraries.++Use these files before generating AWS, Azure, GCP, Kubernetes, BPMN, Cisco, floorplan, infographic, or other library-backed diagrams.++Reference: `style="shape=mxgraph.<library>.<shape_name>"`++## Cloud Providers++| Library | Shapes | Prefix | Description | File |+|---------|--------|--------|-------------|------|+| aws4 | 1031 | `mxgraph.aws4` | Amazon Web Services (2025) - EC2, S3, Lambda, RDS, etc. | [aws4.md](./aws4.md) |+| azure2 | 608 | `img/lib/azure2/` | Microsoft Azure (2024) - VMs, Storage, AI, Networking, etc. | [azure2.md](./azure2.md) |+| gcp2 | 297 | `mxgraph.gcp2` | Google Cloud Platform - Compute Engine, BigQuery, GKE, etc. | [gcp2.md](./gcp2.md) |+| alibaba_cloud | 273 | `mxgraph.alibaba_cloud` | Alibaba Cloud - ECS, OSS, RDS, SLB, VPC, etc. | [alibaba_cloud.md](./alibaba_cloud.md) |+| openstack | 18 | `mxgraph.openstack` | OpenStack cloud platform icons | [openstack.md](./openstack.md) |+| digitalocean | 74 | `mxgraph.digitalocean` | DigitalOcean - Droplets, Spaces, Kubernetes, etc. | [digitalocean.md](./digitalocean.md) |+| salesforce | 96 | `mxgraph.salesforce` | Salesforce platform icons | [salesforce.md](./salesforce.md) |++## Networking & Infrastructure++| Library | Shapes | Prefix | Description | File |+|---------|--------|--------|-------------|------|+| cisco19 | 232 | `mxgraph.cisco19` | Cisco network equipment - routers, switches, firewalls | [cisco19.md](./cisco19.md) |+| network | 58 | `mxgraph.networks` | General network diagram symbols | [network.md](./network.md) |+| arista | 45 | `mxgraph.arista` | Arista network switches and equipment | [arista.md](./arista.md) |+| kubernetes | 40 | `mxgraph.kubernetes` | Kubernetes - pods, services, deployments, nodes | [kubernetes.md](./kubernetes.md) |+| vvd | 93 | `mxgraph.vvd` | VMware Validated Design icons | [vvd.md](./vvd.md) |+| rack | 11 | `mxgraph.rack` | Server rack and data center equipment | [rack.md](./rack.md) |++## Business Process++| Library | Shapes | Prefix | Description | File |+|---------|--------|--------|-------------|------|+| bpmn | 39 | `mxgraph.bpmn` | Business Process Model and Notation - events, gateways, tasks | [bpmn.md](./bpmn.md) |+| eip | 36 | `mxgraph.eip` | Enterprise Integration Patterns - messaging, routing | [eip.md](./eip.md) |+| lean_mapping | 13 | `mxgraph.lean_mapping` | Lean/Value Stream Mapping symbols | [lean_mapping.md](./lean_mapping.md) |++## General Diagrams++| Library | Shapes | Prefix | Description | File |+|---------|--------|--------|-------------|------|+| flowchart | 34 | `mxgraph.flowchart` | Standard flowchart symbols - process, decision, data | [flowchart.md](./flowchart.md) |+| basic | 30 | `mxgraph.basic` | Basic shapes - stars, banners, callouts, hearts | [basic.md](./basic.md) |+| arrows2 | 34 | `mxgraph.arrows2` | Arrow shapes and connectors | [arrows2.md](./arrows2.md) |+| infographic | 29 | `mxgraph.infographic` | Infographic elements - charts, icons, badges | [infographic.md](./infographic.md) |+| sitemap | 50 | `mxgraph.sitemap` | Website sitemap icons - pages, forms, navigation | [sitemap.md](./sitemap.md) |++## UI/Mockups++| Library | Shapes | Prefix | Description | File |+|---------|--------|--------|-------------|------|+| android | 17 | `mxgraph.android` | Android UI mockup components | [android.md](./android.md) |++## Enterprise Software++| Library | Shapes | Prefix | Description | File |+|---------|--------|--------|-------------|------|+| citrix | 97 | `mxgraph.citrix` | Citrix virtualization - XenApp, XenDesktop, NetScaler | [citrix.md](./citrix.md) |+| sap | 98 | `mxgraph.sap` | SAP enterprise software icons | [sap.md](./sap.md) |+| mscae | 73 | `mxgraph.mscae` | Microsoft Cloud and Enterprise symbols | [mscae.md](./mscae.md) |+| atlassian | 26 | `mxgraph.atlassian` | Atlassian - Jira, Confluence issue types | [atlassian.md](./atlassian.md) |++## Engineering++| Library | Shapes | Prefix | Description | File |+|---------|--------|--------|-------------|------|+| fluidpower | 246 | `mxgraph.fluid_power` | Hydraulic/pneumatic engineering symbols | [fluidpower.md](./fluidpower.md) |+| electrical | 50 | `mxgraph.electrical` | Electrical circuit symbols - resistors, capacitors | [electrical.md](./electrical.md) |+| pid | 18 | `mxgraph.pid2` | Piping and Instrumentation Diagram symbols | [pid.md](./pid.md) |+| cabinets | 53 | `mxgraph.cabinets` | Electrical cabinet components - breakers, terminals | [cabinets.md](./cabinets.md) |+| floorplan | 44 | `mxgraph.floorplan` | Floor plan furniture and fixtures | [floorplan.md](./floorplan.md) |++## Icons & Graphics++| Library | Shapes | Prefix | Description | File |+|---------|--------|--------|-------------|------|+| webicons | 176 | `mxgraph.webicons` | Web/social media logos - GitHub, Twitter, AWS, etc. | [webicons.md](./webicons.md) |+| un-ocha-icons | 242 | `mxgraph.un-ocha-icons` | UN OCHA humanitarian icons | [un-ocha-icons.md](./un-ocha-icons.md) |++**Total: 33 libraries, 4,281 shapes**diff --git a/skill/flow-skill/references/shape-libraries/alibaba_cloud.md b/skill/flow-skill/references/shape-libraries/alibaba_cloud.mdnew file mode 100644index 0000000..19936ce--- /dev/null+++ b/skill/flow-skill/references/shape-libraries/alibaba_cloud.md@@ -0,0 +1,328 @@+# alibaba_cloud++**Type:** mxgraph shapes+**Prefix:** `mxgraph.alibaba_cloud`++## Usage++```xml+<mxCell value="label" style="shape=mxgraph.alibaba_cloud.{shape};fillColor=#FF6A00;strokeColor=none;verticalLabelPosition=bottom;verticalAlign=top;align=center;" vertex="1" parent="1">+ <mxGeometry x="0" y="0" width="60" height="60" as="geometry" />+</mxCell>+```++++## Shapes (311)++- `abap_business_application_platform`+- `acms_application_configuration_manangement`+- `acr_cloud_container_registry`+- `actiontrail`+- `adam_advanced_database_and_application_migration`+- `adb_analyticdb_for_mysql`+- `address_purification`+- `afs_fraud_service`+- `agw_aligateway`+- `ahas_application_high_availability_service`+- `airec_artificial_intelligence_recommendation`+- `alb_application_load_balancer_01`+- `alb_application_load_balancer_02`+- `alibaba_cloud_logo`+- `alibaba_cloud_logo_chinese`+- `alibaba_cloud_logo_english`+- `alimail`+- `alimt_machine_translation`+- `aliyun_linux`+- `amqp_advanced_message_queuing_protocol`+- `amscloudapp`+- `analyticdb_for_postgresql`+- `antibot`+- `apigateway`+- `apsara_file_storage_for_hdfs`+- `apsaravideo_vod`+- `arms_application_real-time_monitoring_service`+- `ask_ack_container_service_for_kubernetes`+- `asm_service_mesh`+- `assettech`+- `avds_vulnerability_db_scanning`+- `baas_blockchain_as_a_service`+- `bandwidth_bag`+- `bastionhost`+- `batchcompute`+- `bccluster`+- `beebot`+- `beian`+- `bizdevops`+- `bizworks`+- `bpstudio`+- `cas_ssl_central_authentication_service`+- `cassandra_wide-column_database_01`+- `cassandra_wide-column_database_02`+- `ccc_cloud_call_center`+- `ccn_cloud_connect_network`+- `ccs_customer_service_01`+- `ccs_customer_service_02`+- `cddc_cloud_database_dedicated_cluster`+- `cdn_content_distribution_network`+- `cdp_cloudera_cdp`+- `cdt_cloud_datatransfer`+- `cen_cloud_enterprise_network`+- `cfw_cloud_firewall`+- `cityvisual`+- `clb_classic_load_balancer_01`+- `clb_classic_load_balancer_02`+- `clickhouse`+- `cloud_auth`+- `cloud_config`+- `cloud_display`+- `cloud_governance_center`+- `cloud_security_center`+- `cloud_shield`+- `cloudap`+- `cloudbox`+- `clouddesktop`+- `clouddev`+- `cloudphoto`+- `cloudproc`+- `cloudshell`+- `cmn_cloud_managed_network`+- `cmp_cloud_mobile_push`+- `cms_cloud_monitor_service`+- `codepipeline`+- `codestore`+- `companyreg`+- `computenest`+- `content_security`+- `coo`+- `cpns_cell_phone_number_service`+- `csas_cloud_security_access_service`+- `cvc_cloud_video_conferencing`+- `cwh_cloud_web_hosting`+- `das_database_autonomy_service`+- `databot`+- `datahub`+- `dataphin`+- `dataquotient`+- `datav`+- `dataworks_dataide`+- `dbaudit`+- `dbes_database_expert_service`+- `dbfs_database_file_system`+- `dbs_database_backup`+- `dcdn_dynamic_route_for_cdn`+- `ddh_dedicated_host`+- `ddos-bgp`+- `ddos-dip`+- `ddos-pro`+- `ddos_protection`+- `devops`+- `dg_database_gateway`+- `directmail`+- `disk_block_storage`+- `dlf_data_lake_formation`+- `dms_data_management_service`+- `dns_domain_name_system`+- `dns_privatezone_01`+- `dns_privatezone_02`+- `domain`+- `domain_and_website`+- `drds_distribute_relational_database_service`+- `dsi_data_security_insurance`+- `dts_data_transmission_service`+- `e-mapreduce`+- `eais_elastic_accelerated_computing_instances`+- `eci_elastic_container_instance`+- `ecs_elastic_compute_service`+- `edas_enterprise_distributed_application_service`+- `ehpc_elastic_high_performance_computing`+- `eip_elastic_ip_address`+- `elastic_web_hosting`+- `elasticsearch`+- `emas_enterprise_mobile_application_studio`+- `energyexpert`+- `ens_edge_node_service`+- `enterprise_website`+- `eprofile`+- `esign`+- `ess_elastic_scaling_service`+- `eventbridge`+- `express_connect`+- `face_recognition`+- `fc_function_compute`+- `flow_service`+- `flowbag`+- `fnf_serverless_function_flow`+- `fpga_field_programmable_gate_array`+- `fraud_detection`+- `ga_global_accelerator`+- `gameshield`+- `gdb_graph_database`+- `graphanalytics`+- `graphcompute`+- `gtm_global_traffic_manager`+- `gts_global_transaction_service`+- `gws_graphic_workstation`+- `havip_high-availability_virtual_ip_address`+- `hbase`+- `hbr_hybrid_backup_recovery`+- `hcs-hgw_hybrid_cloud_storage_array`+- `hcs-mgw_hybrid_cloud_storage_datatransport`+- `hcs-sgw_hybrid_cloud_storage_gateway`+- `hdr_hybrid_disaster_recovery`+- `hologres`+- `holowatcher`+- `hsm_hardware_security_module`+- `httpdns`+- `idrsservice`+- `image_recognition`+- `imagesearch`+- `imarketing`+- `imm_intelligent_media_management`+- `imp_intelligent_media_production`+- `imp_low_code_video_factory`+- `indvi_industrial_visual_intelligence`+- `intelligent_advisor`+- `iot_internet_of_things_platform`+- `iot_wireless_connection_service`+- `iotid_identity`+- `iov_iot_vehicle_cloud`+- `ipv6_gateway`+- `isoc_iot_security_operations_center`+- `isu_intelligent_semantic_understanding`+- `ivision`+- `ivpd_intelligent_visual_production`+- `kafka`+- `linkedmall`+- `linkwan`+- `live`+- `livinglink`+- `log_streaming`+- `logic_composer`+- `machine_learning`+- `man_mobile_analytics`+- `mariadb`+- `mas_mobile_acceleration_service`+- `maxcompute`+- `memcache`+- `miniappdev`+- `mns_message_service`+- `mobile_hotfix`+- `mobsec`+- `mongodb`+- `mps-ai`+- `mps-censor`+- `mps-cover`+- `mps-dna`+- `mps-multimod`+- `mps-produce`+- `mps_apsaravideo_media_processing`+- `mq_message_queue`+- `mqc_mobile_quality_center`+- `mse_microservices_engine`+- `multi-cloud_finops`+- `multi-mode_database_lindorm`+- `multimediaai`+- `mxgraph.alibaba_cloud`+- `mysql`+- `nas_network_attached_storage`+- `nat_gateway`+- `network_acl_access_control_list`+- `nlb_network_load_balancer_01`+- `nlb_network_load_balancer_02`+- `nlp-address`+- `nlp-automl`+- `nlp-ie_text_information_extraction`+- `nlp-ke_keyword_extraction`+- `nlp-ner_named_entity_recognition`+- `nlp-pos_part-of-speech_tagging`+- `nlp-ra_reflexive_anaphora`+- `nlp-sa_sentiment_analysis`+- `nlp-tc_text_categorization`+- `nlp-ws_word_segmentation`+- `nlp_natural_language_processing`+- `nls`+- `nls-asrbag`+- `nls-asrcustommodel`+- `nls-filebag`+- `nls-service`+- `nls-shortasrbag`+- `nls-ttsbag`+- `nodejs_performance_platform`+- `oceanbase`+- `ocr_optical_character_recognition`+- `onsmqtt_micro_message_queuing_telemetry_transport`+- `oos_operation_orchestration_service`+- `openanalytics`+- `openapi_explorer`+- `opensearch`+- `oss_object_storage_service`+- `ots_tablestore`+- `outboundbot`+- `pcdn_p2p_cdn`+- `petadata_hybriddb_for_mysql`+- `physical_connection`+- `pnvs_phone_number_verification_service`+- `polardb`+- `porana_portrait_analysis`+- `postgresql`+- `ppas_pay-as-you-go_database`+- `privatelink`+- `prometheus`+- `prophet`+- `pts_performance_test_service`+- `quickbi`+- `ram_resource_access_management`+- `re_recommendation_engine`+- `realtime_compute`+- `redis_kvstore`+- `region`+- `retailir`+- `ros_resource_orchestration_service`+- `route_table`+- `router`+- `rsimganalys`+- `rtc_real-time_communication`+- `sae_serverless_app_engine`+- `sag_smart_access_gateway_01`+- `sag_smart_access_gateway_02`+- `sas_situational_awareness`+- `sca_smart_conversation_analysis_01`+- `sca_smart_conversation_analysis_02`+- `scc_super_computing_cluster`+- `scdn_secure_cdn`+- `scu_storage_capacity_unit`+- `sddp_sensitive_data_protection`+- `shared_bandwidth`+- `shared_flow_bag`+- `shc_shield_hybrid_cloud`+- `slb_server_load_balancer_01`+- `slb_server_load_balancer_02`+- `slb_server_load_balancer_03`+- `sls_simple_log_service`+- `smc_server_migration_center`+- `sms_short_message_service`+- `sos`+- `spark_data_insights`+- `sppc`+- `sqlserver`+- `swas_simple_application_server`+- `tr_transit_router`+- `trademark_service`+- `uis_ultimate_internet_service`+- `user`+- `user_feedback_01`+- `user_feedback_02`+- `vbr_virtual_border_router`+- `vcs_visual_computing_service`+- `vms_voice_messaging_service`+- `voicebot_intelligent_voice_navigation`+- `vpc_virtual_private_cloud`+- `vpn_gateway`+- `vs_video_surveillance`+- `vswitch`+- `waf_web_application_firewall`+- `webplus_web_app_service`+- `xdragon_bare_metal_server`+- `xtrace`+- `yida`diff --git a/skill/flow-skill/references/shape-libraries/android.md b/skill/flow-skill/references/shape-libraries/android.mdnew file mode 100644index 0000000..3a3fb9c--- /dev/null+++ b/skill/flow-skill/references/shape-libraries/android.md@@ -0,0 +1,62 @@+# android++**Type:** mxgraph shapes+**Prefix:** `mxgraph.android`++## Usage++```xml+<mxCell value="label" style="shape=mxgraph.android.phone2;strokeColor=#c0c0c0;" vertex="1" parent="1">+ <mxGeometry x="0" y="0" width="200" height="390" as="geometry" />+</mxCell>+```++## Shapes (47)++- `action_bar`+- `action_bar_landscape`+- `anchor`+- `checkbox`+- `contact_badge_focused`+- `contextual_action_bar`+- `contextual_action_bar_landscape`+- `contextual_split_action_bar`+- `contextual_split_action_bar_landscape`+- `contextual_split_action_bar_landscape_white`+- `indeterminateSpinner`+- `indeterminate_progress_bar`+- `keyboard`+- `navigation_bar_1`+- `navigation_bar_1_landscape`+- `navigation_bar_1_vertical`+- `navigation_bar_2`+- `navigation_bar_3`+- `navigation_bar_3_landscape`+- `navigation_bar_4`+- `navigation_bar_5`+- `navigation_bar_5_vertical`+- `navigation_bar_6`+- `phone2`+- `progressBar`+- `progressScrubberDisabled`+- `progressScrubberFocused`+- `progressScrubberPressed`+- `quick_contact`+- `quickscroll2`+- `quickscroll3`+- `rect`+- `rrect`+- `scrollbars2`+- `spinner2`+- `split_action_bar`+- `split_action_bar_landscape`+- `statusBar`+- `switch_off`+- `switch_on`+- `tab2`+- `textSelHandles`+- `text_insertion_point`+- `textfield`+- `time_picker`+- `time_picker_dark`+- `transparent`diff --git a/skill/flow-skill/references/shape-libraries/arrows2.md b/skill/flow-skill/references/shape-libraries/arrows2.mdnew file mode 100644index 0000000..5cd8137--- /dev/null+++ b/skill/flow-skill/references/shape-libraries/arrows2.md@@ -0,0 +1,33 @@+# arrows2++**Type:** mxgraph shapes+**Prefix:** `mxgraph.arrows2`++## Usage++```xml+<mxCell value="label" style="shape=mxgraph.arrows2.arrow;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">+ <mxGeometry x="0" y="0" width="100" height="60" as="geometry" />+</mxCell>+```++## Shapes (18)++- `arrow`+- `bendArrow`+- `bendDoubleArrow`+- `calloutArrow`+- `calloutDouble90Arrow`+- `calloutDoubleArrow`+- `calloutQuadArrow`+- `jumpInArrow`+- `quadArrow`+- `sharpArrow`+- `sharpArrow2`+- `stripedArrow`+- `stylisedArrow`+- `tailedArrow`+- `tailedNotchedArrow`+- `triadArrow`+- `twoWayArrow`+- `uTurnArrow`diff --git a/skill/flow-skill/references/shape-libraries/atlassian.md b/skill/flow-skill/references/shape-libraries/atlassian.mdnew file mode 100644index 0000000..dcbfbc7--- /dev/null+++ b/skill/flow-skill/references/shape-libraries/atlassian.md@@ -0,0 +1,32 @@+# atlassian++**Type:** SVG images+**Path:** `img/lib/atlassian/`++## Usage++```xml+<mxCell value="label" style="image;aspect=fixed;image=img/lib/atlassian/Jira_Logo.svg;verticalLabelPosition=bottom;verticalAlign=top;align=center;" vertex="1" parent="1">+ <mxGeometry x="0" y="0" width="60" height="60" as="geometry" />+</mxCell>+```++## Shapes (17)++- `Atlassian_Logo`+- `Bamboo_Logo`+- `Bitbucket_Logo`+- `Clover_Logo`+- `Confluence_Logo`+- `Crowd_Logo`+- `Crucible_Logo`+- `Fisheye_Logo`+- `Hipchat_Logo`+- `Jira_Core_Logo`+- `Jira_Logo`+- `Jira_Service_Desk_Logo`+- `Jira_Software_Logo`+- `Sourcetree_Logo`+- `Statuspage_Logo`+- `Stride_Logo`+- `Trello_Logo`diff --git a/skill/flow-skill/references/shape-libraries/aws4.md b/skill/flow-skill/references/shape-libraries/aws4.mdnew file mode 100644index 0000000..fe4b248--- /dev/null+++ b/skill/flow-skill/references/shape-libraries/aws4.md@@ -0,0 +1,1049 @@+# aws4++**Type:** mxgraph shapes+**Prefix:** `mxgraph.aws4`++## Usage++```xml+<mxCell value="label" style="shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.{shape};fillColor=#ED7100;strokeColor=#ffffff;verticalLabelPosition=bottom;verticalAlign=top;align=center;" vertex="1" parent="1">+ <mxGeometry x="0" y="0" width="60" height="60" as="geometry" />+</mxCell>+```++For simple shapes use: `shape=mxgraph.aws4.{shape};fillColor=#232F3D;`++## Shapes (1032)++- `a1_instance`+- `access_analyzer`+- `action`+- `activate`+- `actuator`+- `ad_connector`+- `addon`+- `agent`+- `agent2`+- `alarm`+- `alert`+- `alexa_enabled_device`+- `alexa_for_business`+- `alexa_skill`+- `alexa_smart_home_skill`+- `alexa_voice_service`+- `all_products`+- `ami`+- `amplify`+- `amplify_aws_amplify_studio`+- `analytics`+- `apache_mxnet_on_aws`+- `api_gateway`+- `app_config`+- `app_mesh`+- `app_runner`+- `app_studio`+- `app_wizard`+- `appfabric`+- `appflow`+- `application`+- `application_auto_scaling`+- `application_composer`+- `application_cost_profiler`+- `application_discovery_service`+- `application_discovery_service_aws_agentless_collector`+- `application_discovery_service_aws_discovery_agent`+- `application_discovery_service_migration_evaluator_collector`+- `application_integration`+- `application_load_balancer`+- `application_recovery_controller`+- `apps`+- `appstream_20`+- `appsync`+- `ar_vr`+- `archive`+- `artifact`+- `athena`+- `athena_data_source_connectors`+- `attribute`+- `attributes`+- `audit_manager`+- `augmented_ai`+- `aurora`+- `aurora_instance`+- `aurora_instance_alt`+- `authenticated_user`+- `auto_scaling`+- `auto_scaling2`+- `auto_scaling3`+- `automation`+- `autoscaling`+- `aws_backup_for_aws_cloudformation`+- `aws_backup_legal_hold`+- `aws_backup_support_for_amazon_fsx_for_netapp_ontap`+- `aws_backup_vault_lock`+- `aws_backup_virtual_machine_monitor`+- `aws_cloud`+- `aws_glue_data_quality`+- `aws_glue_for_ray`+- `aws_user_notifications`+- `b2b_data_interchange`+- `backint_agent`+- `backup`+- `backup_audit_manager`+- `backup_aws_backup_support_for_amazon_s3`+- `backup_aws_backup_support_for_vmware_workloads`+- `backup_backup_plan`+- `backup_backup_restore`+- `backup_compliance_reporting`+- `backup_compute`+- `backup_database`+- `backup_gateway`+- `backup_plan`+- `backup_recovery_point_objective`+- `backup_recovery_time_objective`+- `backup_restore`+- `backup_storage`+- `backup_vault`+- `backup_virtual_machine`+- `backup_virtual_machine_monitor`+- `bank`+- `batch`+- `bedrock`+- `blockchain`+- `blockchain_resource`+- `bottlerocket`+- `braket`+- `braket_chandelier`+- `braket_chip`+- `braket_embedded_simulator`+- `braket_managed_simulator`+- `braket_noise_simulator`+- `braket_qpu`+- `braket_simulator`+- `braket_simulator_1`+- `braket_simulator_2`+- `braket_simulator_3`+- `braket_simulator_4`+- `braket_state_vector`+- `braket_tensor_network`+- `bucket`+- `bucket_with_objects`+- `budgets`+- `budgets_2`+- `business_application`+- `bycicle`+- `c4_instance`+- `c5_instance`+- `c5a`+- `c5ad`+- `c5d`+- `c5n_instance`+- `c6g_instance`+- `c6gd`+- `cache_node`+- `cached_volume`+- `camera`+- `camera2`+- `car`+- `cart`+- `certificate_manager`+- `certificate_manager_2`+- `certificate_manager_3`+- `change_set`+- `chat`+- `chatbot`+- `checklist`+- `checklist_cost`+- `checklist_fault_tolerant`+- `checklist_performance`+- `checklist_security`+- `chime`+- `chime_sdk`+- `classic_load_balancer`+- `clean_rooms`+- `client`+- `client_vpn`+- `cloud9`+- `cloud_control_api`+- `cloud_development_kit`+- `cloud_digital_interface`+- `cloud_directory`+- `cloud_extension_ros`+- `cloud_map`+- `cloud_map_resource`+- `cloud_wan`+- `cloud_wan_segment_network`+- `cloud_wan_transit_gateway_route_table_attachment`+- `cloud_wan_virtual_pop`+- `cloudendure_disaster_recovery`+- `cloudendure_migration`+- `cloudformation`+- `cloudfront`+- `cloudfront_functions`+- `cloudhsm`+- `cloudsearch`+- `cloudsearch2`+- `cloudshell`+- `cloudtrail`+- `cloudtrail_cloudtrail_lake`+- `cloudwatch`+- `cloudwatch_2`+- `cloudwatch_cross_account_observability`+- `cloudwatch_data_protection`+- `cloudwatch_evidently`+- `cloudwatch_logs`+- `cloudwatch_metrics_insights`+- `cloudwatch_rum`+- `cloudwatch_synthetics`+- `cluster`+- `codeartifact`+- `codebuild`+- `codecatalyst`+- `codecommit`+- `codedeploy`+- `codeguru`+- `codeguru_2`+- `codepipeline`+- `codestar`+- `codewhisperer`+- `coffee_pot`+- `cognito`+- `cold_storage`+- `command_line_interface`+- `comprehend`+- `comprehend_medical`+- `compute`+- `compute_optimizer`+- `config`+- `connect`+- `connector`+- `contact_center`+- `container_1`+- `container_2`+- `container_3`+- `container_registry_image`+- `containers`+- `control_tower`+- `corporate_data_center`+- `corporate_data_center2`+- `corretto`+- `cost_and_usage_report`+- `cost_explorer`+- `cost_management`+- `credentials`+- `custom_billing_manager`+- `custom_event_bus_resource`+- `customer_enablement`+- `customer_engagement`+- `customer_gateway`+- `d2_instance`+- `d3_instance`+- `d3en_instance`+- `data_encryption_key`+- `data_exchange`+- `data_exchange_for_apis`+- `data_lake_resource_icon`+- `data_pipeline`+- `data_set`+- `data_stream`+- `data_table`+- `data_transfer_terminal`+- `database`+- `database_migration_service`+- `database_migration_workflow_job`+- `datasync`+- `datasync_discovery`+- `datazone`+- `datazone_business_data_catalog`+- `datazone_data_portal`+- `datazone_data_projects`+- `db_instance`+- `db_instance_read_replica`+- `db_instance_standby`+- `db_on_instance`+- `db_on_instance2`+- `deadline_cloud`+- `deep_learning_amis`+- `deep_learning_containers`+- `deepcomposer`+- `deeplens`+- `deepracer`+- `default_event_bus_resource`+- `dense_compute_node`+- `dense_storage_node`+- `deployment`+- `deployments`+- `desired_state`+- `desktop_and_app_streaming`+- `detective`+- `developer_tools`+- `development_environment`+- `device_farm`+- `devops_guru`+- `devops_guru_insights`+- `direct_connect`+- `directory_service`+- `disk`+- `distro_for_opentelemetry`+- `document`+- `documentdb_elastic_clusters`+- `documentdb_with_mongodb_compatibility`+- `documents`+- `documents2`+- `documents3`+- `door_lock`+- `download_distribution`+- `dynamodb`+- `dynamodb_dax`+- `dynamodb_standard_access_table_class`+- `dynamodb_standard_infrequent_access_table_class`+- `dynamodb_stream`+- `ec2`+- `ec2_aws_microservice_extractor_for_net`+- `ec2_c6a_instance`+- `ec2_c6gn_instance`+- `ec2_c6i_instance`+- `ec2_c6in_instance`+- `ec2_c7g_instance`+- `ec2_c7gn_instance`+- `ec2_dl1_instance`+- `ec2_g5_instance`+- `ec2_g5g_instance`+- `ec2_hpc6a_instance`+- `ec2_hpc6id_instance`+- `ec2_i4i_instance`+- `ec2_im4gn_instance`+- `ec2_image_builder`+- `ec2_inf2_instance`+- `ec2_instance_contents`+- `ec2_is4gen_instance`+- `ec2_m1_mac_instance`+- `ec2_m6a_instance`+- `ec2_m6i_instance`+- `ec2_m6idn_instance`+- `ec2_m6in_instance`+- `ec2_p4de_instance`+- `ec2_r6a_instance`+- `ec2_r6i_instance`+- `ec2_r6idn_instance`+- `ec2_r6in_instance`+- `ec2_r7iz_instance`+- `ec2_trn1_instance`+- `ec2_vt1_instance`+- `ec2_x2gd_instance`+- `ec2_x2idn_instance`+- `ec2_x2iedn_instance`+- `ec2_x2iezn_instance`+- `echo`+- `ecr`+- `ecs`+- `ecs_anywhere`+- `ecs_copilot_cli`+- `ecs_service`+- `ecs_service_connect`+- `ecs_task`+- `edge_location`+- `efs_infrequentaccess`+- `efs_standard`+- `eks`+- `eks_anywhere`+- `eks_cloud`+- `eks_distro`+- `eks_on_outposts`+- `elastic_beanstalk`+- `elastic_block_store`+- `elastic_block_store_amazon_data_lifecycle_manager`+- `elastic_block_store_volume_gp3`+- `elastic_fabric_adapter`+- `elastic_file_system`+- `elastic_file_system_elastic_throughput`+- `elastic_file_system_infrequent_access`+- `elastic_file_system_intelligent_tiering`+- `elastic_file_system_one_zone`+- `elastic_file_system_one_zone_infrequent_access`+- `elastic_file_system_one_zone_standard`+- `elastic_file_system_standard`+- `elastic_file_system_standard_infrequent_access`+- `elastic_inference`+- `elastic_inference_2`+- `elastic_ip_address`+- `elastic_load_balancing`+- `elastic_network_adapter`+- `elastic_network_interface`+- `elastic_transcoder`+- `elastic_vmware_service`+- `elasticache`+- `elasticache_for_memcached`+- `elasticache_for_redis`+- `elasticache_for_valkey`+- `elasticsearch_service`+- `elemental`+- `elemental_link`+- `elemental_mediaconnect`+- `elemental_mediaconvert`+- `elemental_medialive`+- `elemental_mediapackage`+- `elemental_mediastore`+- `elemental_mediatailor`+- `email`+- `email_2`+- `email_notification`+- `emr`+- `emr_engine`+- `emr_engine_mapr_m3`+- `emr_engine_mapr_m5`+- `emr_engine_mapr_m7`+- `encrypted_data`+- `end_user_messaging`+- `endpoint`+- `endpoints`+- `entity_resolution`+- `event`+- `event_event_based`+- `event_resource`+- `event_time_based`+- `eventbridge`+- `eventbridge_custom_event_bus_resource`+- `eventbridge_default_event_bus_resource`+- `eventbridge_pipes`+- `eventbridge_saas_partner_event_bus_resource`+- `eventbridge_scheduler`+- `eventbridge_schema`+- `eventbridge_schema_registry`+- `express_workflow`+- `external_sdk`+- `external_toolkit`+- `f1_instance`+- `factory`+- `fargate`+- `fault_injection_simulator`+- `file_cache`+- `file_cache_hybrid_nfs_linked_datasets`+- `file_cache_on_premises_nfs_linked_datasets`+- `file_cache_s3_linked_datasets`+- `file_gateway`+- `file_system`+- `filtering_rule`+- `finding`+- `finspace`+- `firetv`+- `firetv_stick`+- `firewall_manager`+- `fleet_management`+- `flow_logs`+- `folder`+- `folders`+- `forecast`+- `forums`+- `fraud_detector`+- `freertos`+- `fsx`+- `fsx_file_gateway`+- `fsx_for_lustre`+- `fsx_for_netapp_ontap`+- `fsx_for_openzfs`+- `fsx_for_windows_file_server`+- `g3_instance`+- `g4ad_instance`+- `g4dn`+- `game_tech`+- `game_tech2`+- `gamekit`+- `gamelift`+- `gamelift_2`+- `gamelift_streams`+- `games`+- `gamesparks`+- `gateway`+- `gateway_load_balancer`+- `gear`+- `general`+- `general_access_points`+- `generic`+- `generic_application`+- `generic_database`+- `generic_firewall`+- `genomics_cli`+- `git_repository`+- `glacier`+- `glacier_deep_archive`+- `global_accelerator`+- `global_secondary_index`+- `globe`+- `glue`+- `glue_crawlers`+- `glue_data_catalog`+- `glue_databrew`+- `glue_elastic_views`+- `greengrass`+- `ground_station`+- `group_account`+- `group_auto_scaling_group`+- `group_availability_zone`+- `group_aws_cloud`+- `group_aws_cloud_alt`+- `group_aws_step_functions_workflow`+- `group_corporate_data_center`+- `group_ec2_instance_contents`+- `group_elastic_beanstalk`+- `group_elastic_load_balancing`+- `group_iot_greengrass`+- `group_iot_greengrass_deployment`+- `group_on_premise`+- `group_region`+- `group_security_group`+- `group_spot_fleet`+- `group_subnet`+- `group_vpc`+- `group_vpc2`+- `guardduty`+- `h1_instance`+- `habana_gaudi`+- `hardware_board`+- `hdfs_cluster`+- `healthimaging`+- `healthlake`+- `healthscribe`+- `high_memory_instance`+- `honeycode`+- `hosted_zone`+- `house`+- `http2_protocol`+- `http_notification`+- `http_protocol`+- `i2`+- `i3_instance`+- `i3en`+- `identity_access_management_iam_roles_anywhere`+- `identity_and_access_management`+- `illustration_desktop`+- `illustration_devices`+- `illustration_notification`+- `illustration_office_building`+- `illustration_users`+- `import_export`+- `inf1`+- `inferentia`+- `infrequent_access_storage_class`+- `inspector`+- `instance`+- `instance2`+- `instance_with_cloudwatch`+- `instance_with_cloudwatch2`+- `instances`+- `instances_2`+- `intelligent_tiering`+- `interactive_video`+- `internet`+- `internet_alt1`+- `internet_alt2`+- `internet_alt22`+- `internet_gateway`+- `internet_of_things`+- `inventory`+- `iot_1click`+- `iot_analytics`+- `iot_analytics_channel`+- `iot_analytics_data_store`+- `iot_analytics_dataset`+- `iot_analytics_pipeline`+- `iot_button`+- `iot_core`+- `iot_core_device_advisor`+- `iot_core_device_location`+- `iot_device_defender`+- `iot_device_defender_iot_device_jobs`+- `iot_device_gateway`+- `iot_device_jobs_resource`+- `iot_device_management`+- `iot_device_management_fleet`+- `iot_device_tester`+- `iot_edukit`+- `iot_events`+- `iot_expresslink`+- `iot_fleetwise`+- `iot_greengrass_artifact`+- `iot_greengrass_component`+- `iot_greengrass_component_machine_learning`+- `iot_greengrass_component_nucleus`+- `iot_greengrass_component_private`+- `iot_greengrass_component_public`+- `iot_greengrass_interprocess_communication`+- `iot_greengrass_protocol`+- `iot_greengrass_recipe`+- `iot_greengrass_stream_manager`+- `iot_lorawan_protocol`+- `iot_over_the_air_update`+- `iot_roborunner`+- `iot_sailboat`+- `iot_sitewise`+- `iot_sitewise_asset`+- `iot_sitewise_asset_hierarchy`+- `iot_sitewise_asset_model`+- `iot_sitewise_asset_properties`+- `iot_sitewise_data_streams`+- `iot_thing_freertos_device`+- `iot_thing_humidity_sensor`+- `iot_thing_industrial_pc`+- `iot_thing_plc`+- `iot_thing_relay`+- `iot_thing_stacklight`+- `iot_thing_temperature_humidity_sensor`+- `iot_thing_temperature_sensor`+- `iot_thing_temperature_vibration_sensor`+- `iot_thing_vibration_sensor`+- `iot_things_graph`+- `iot_twinmaker`+- `iq`+- `item`+- `items`+- `json_script`+- `kendra`+- `key_management_service`+- `key_management_service_external_key_store`+- `keyspaces`+- `kinesis`+- `kinesis_data_analytics`+- `kinesis_data_firehose`+- `kinesis_data_streams`+- `kinesis_video_streams`+- `lake_formation`+- `lambda`+- `lambda_function`+- `layers`+- `lex`+- `license_manager`+- `license_manager_application_discovery`+- `license_manager_license_blending`+- `lightbulb`+- `lightsail`+- `lightsail_for_research`+- `local_zones`+- `location_service`+- `location_service_geofence`+- `location_service_map`+- `location_service_place`+- `location_service_routes`+- `location_service_track`+- `logs`+- `long_term_security_credential`+- `lookout_for_equipment`+- `lookout_for_metrics`+- `lookout_for_vision`+- `lumberyard`+- `m4_instance`+- `m5_instance`+- `m5a_instance`+- `m5d_instance`+- `m5dn_instance`+- `m5n`+- `m5n_instance`+- `m5zn_instance`+- `m6g_instance`+- `m6gd_instance`+- `mac_instance`+- `machine_learning`+- `macie`+- `magnifying_glass`+- `magnifying_glass_2`+- `mainframe_modernization`+- `mainframe_modernization_analyzer`+- `mainframe_modernization_compiler`+- `mainframe_modernization_converter`+- `mainframe_modernization_developer`+- `mainframe_modernization_runtime`+- `maintenance_windows`+- `managed_apache_cassandra_service`+- `managed_blockchain`+- `managed_ms_ad`+- `managed_service_for_apache_flink`+- `managed_service_for_grafana`+- `managed_service_for_prometheus`+- `managed_services`+- `managed_streaming_for_kafka`+- `managed_workflows_for_apache_airflow`+- `management_and_governance`+- `management_console`+- `management_console2`+- `marketplace`+- `media_services`+- `mediaconnect_gateway`+- `medical_emergency`+- `memorydb_for_redis`+- `mesh`+- `message`+- `metrics`+- `mfa_token`+- `migration_and_transfer`+- `migration_evaluator`+- `migration_hub`+- `migration_hub_refactor_spaces_applications`+- `migration_hub_refactor_spaces_environments`+- `migration_hub_refactor_spaces_services`+- `mobile`+- `mobile_application`+- `mobile_client`+- `mobile_hub`+- `monitoring`+- `monitron`+- `mq`+- `mq_broker`+- `mqtt_protocol`+- `ms_sql_instance`+- `ms_sql_instance_alternate`+- `msk_amazon_msk_connect`+- `multimedia`+- `multiple_volumes_resource`+- `mxgraph.aws4`+- `mysql_db_instance`+- `mysql_db_instance_alternate`+- `namespace`+- `nat_gateway`+- `neptune`+- `network_access_control_list`+- `network_firewall`+- `network_firewall_endpoints`+- `network_load_balancer`+- `networking_and_content_delivery`+- `neuron_ml_sdk`+- `nice_dcv`+- `nice_enginframe`+- `nimble_studio`+- `nitro_enclaves`+- `non_cached_volume`+- `notebook`+- `nova`+- `nova2`+- `object`+- `office_building`+- `omics`+- `one_zone_ia`+- `open_3d_engine`+- `open_3d_engine_2`+- `opensearch_dashboards`+- `opensearch_ingestion`+- `opensearch_observability`+- `opensearch_service_cluster_administrator_node`+- `opensearch_service_data_node`+- `opensearch_service_index`+- `opensearch_service_traces`+- `opensearch_service_ultrawarm_node`+- `opsworks`+- `opsworks_apps`+- `opsworks_permissions`+- `optimized_instance`+- `oracle_database_at_aws`+- `oracle_db_instance`+- `oracle_db_instance_alternate`+- `organizations`+- `organizations_account`+- `organizations_account2`+- `organizations_management_account`+- `organizations_management_account2`+- `organizations_organizational_unit`+- `organizations_organizational_unit2`+- `outposts`+- `outposts_1u_and_2u_servers`+- `outposts_family`+- `p2_instance`+- `p3_instance`+- `p3dn_instance`+- `p4_instance`+- `p4d_instance`+- `panorama`+- `parallel_cluster`+- `parallel_computing_service`+- `parameter_store`+- `patch_manager`+- `payment_cryptography`+- `peering`+- `permissions`+- `permissions_2`+- `personal_health_dashboard`+- `personalize`+- `pinpoint`+- `pinpoint_journey`+- `police_emergency`+- `policy`+- `polly`+- `postgresql_instance`+- `private_5g`+- `private_certificate_authority`+- `privatelink`+- `professional_services`+- `programming_language`+- `proton`+- `q`+- `quantum_ledger_database`+- `quantum_technologies`+- `question`+- `queue`+- `quicksight`+- `quicksight_paginated_reports`+- `r4_instance`+- `r5_instance`+- `r5a_instance`+- `r5ad_instance`+- `r5b_instance`+- `r5d_instance`+- `r5gd_instance`+- `r5n`+- `r5n_instance`+- `r6g_instance`+- `rdn_instance`+- `rds`+- `rds_blue_green_deployments`+- `rds_instance`+- `rds_instance_alt`+- `rds_mariadb_instance`+- `rds_mariadb_instance_alt`+- `rds_multi_az`+- `rds_multi_az_db_cluster`+- `rds_mysql_instance`+- `rds_mysql_instance_alt`+- `rds_on_vmware`+- `rds_optimized_writes`+- `rds_oracle_instance`+- `rds_oracle_instance_alt`+- `rds_piop`+- `rds_piops`+- `rds_postgresql_instance`+- `rds_postgresql_instance_alt`+- `rds_proxy`+- `rds_proxy_alt`+- `rds_sql_server_instance`+- `rds_sql_server_instance_alt`+- `rds_trusted_language_extensions_for_postgresql`+- `recover`+- `red_hat_openshift`+- `redshift`+- `redshift_auto_copy`+- `redshift_data_sharing_governance`+- `redshift_ml`+- `redshift_query_editor_v20_light`+- `redshift_ra3`+- `redshift_streaming_ingestion`+- `registry`+- `rekognition`+- `rekognition_2`+- `rekognition_image`+- `rekognition_video`+- `replication`+- `replication_time_control`+- `reported_state`+- `repost`+- `repost_private`+- `rescue`+- `reserved_instance_reporting`+- `resilience_hub`+- `resource`+- `resource_access_manager`+- `resource_explorer`+- `resources`+- `robomaker`+- `robotics`+- `role`+- `route_53`+- `route_53_application_recovery_controller`+- `route_53_readiness_checks`+- `route_53_resolver`+- `route_53_resolver_dns_firewall`+- `route_53_resolver_query_logging`+- `route_53_routing_controls`+- `route_table`+- `router`+- `rule`+- `rule_2`+- `rule_3`+- `run_command`+- `s3`+- `s3_batch_operations`+- `s3_express_one_zone`+- `s3_file_gateway`+- `s3_multi_region_access_points`+- `s3_object_lambda`+- `s3_object_lambda_access_points`+- `s3_object_lock`+- `s3_on_outposts`+- `s3_on_outposts_storage`+- `s3_replication_time_control`+- `s3_select`+- `s3_storage_lens`+- `s3_tables`+- `s3_vectors`+- `saas_event_bus_resource`+- `sagemaker`+- `sagemaker_2`+- `sagemaker_canvas`+- `sagemaker_geospatial_ml`+- `sagemaker_ground_truth`+- `sagemaker_model`+- `sagemaker_notebook`+- `sagemaker_shadow_testing`+- `sagemaker_studio_lab`+- `sagemaker_train`+- `saml_token`+- `satellite`+- `savings_plans`+- `search_documents`+- `secrets_manager`+- `security_group`+- `security_hub`+- `security_hub_finding`+- `security_identity_and_compliance`+- `security_incident_response`+- `security_lake`+- `sensor`+- `server_migration_service`+- `serverless`+- `serverless_application_repository`+- `servers`+- `service`+- `service_catalog`+- `service_management_connector`+- `servo`+- `shadow`+- `shield`+- `shield2`+- `shield_shield_advanced`+- `signer`+- `simple_ad`+- `simple_email_service`+- `simple_storage_service_directory_bucket`+- `simple_storage_service_s3_glacier_instant_retrieval`+- `simspace_weaver`+- `simulation`+- `simulator`+- `single_sign_on`+- `site_to_site_vpn`+- `snapshot`+- `snowball`+- `snowball_edge`+- `snowcone`+- `snowmobile`+- `sns`+- `source_code`+- `spot_instance`+- `sql_primary`+- `sql_replica`+- `sql_workbench`+- `sqs`+- `ssl_padlock`+- `stack`+- `stack2`+- `standard_ia`+- `state_manager`+- `step_functions`+- `storage`+- `storage_gateway`+- `streaming_distribution`+- `sts`+- `sts_alternate`+- `sumerian`+- `supply_chain`+- `support`+- `systems_manager`+- `systems_manager_application_manager`+- `systems_manager_change_calendar`+- `systems_manager_change_manager`+- `systems_manager_compliance`+- `systems_manager_distributor`+- `systems_manager_incident_manager`+- `systems_manager_opscenter`+- `systems_manager_session_manager`+- `t2_instance`+- `t3_instance`+- `t3a_instance`+- `t4g_instance`+- `table`+- `tape_gateway`+- `tape_storage`+- `telco_network_builder`+- `template`+- `temporary_security_credential`+- `tensorflow_on_aws`+- `textract`+- `textract_analyze_lending`+- `thermostat`+- `thinkbox_deadline`+- `thinkbox_draft`+- `thinkbox_frost`+- `thinkbox_krakatoa`+- `thinkbox_sequoia`+- `thinkbox_stoke`+- `thinkbox_xmesh`+- `timestream`+- `tools_and_sdks`+- `topic`+- `topic_2`+- `torchserve`+- `traditional_server`+- `training_certification`+- `trainium_instance`+- `transcribe`+- `transfer_family`+- `transfer_family_aws_as2`+- `transfer_for_ftp_resource`+- `transfer_for_ftps_resource`+- `transfer_for_sftp`+- `transfer_for_sftp_resource`+- `transform`+- `transit_gateway`+- `transit_gateway_attachment`+- `translate`+- `travel`+- `trusted_advisor`+- `user`+- `user_notifications`+- `users`+- `utility`+- `vault`+- `verified_access`+- `verified_permissions`+- `virtual_gateway`+- `virtual_node`+- `virtual_private_cloud`+- `virtual_router`+- `virtual_service`+- `virtual_tape_library`+- `vmware_cloud_on_aws`+- `volume`+- `volume_gateway`+- `vpc`+- `vpc_access_points`+- `vpc_carrier_gateway`+- `vpc_lattice`+- `vpc_network_access_analyzer`+- `vpc_privatelink`+- `vpc_reachability_analyzer`+- `vpc_traffic_mirroring`+- `vpc_virtual_private_cloud_vpc`+- `vpn_connection`+- `vpn_gateway`+- `waf`+- `waf_bad_bot`+- `waf_bot`+- `waf_bot_control`+- `waf_labels`+- `waf_managed_rule`+- `waf_rule`+- `wavelength`+- `well_architect_tool`+- `well_architected_tool`+- `wickr`+- `windfarm`+- `work_package`+- `workdocs`+- `worklink`+- `workmail`+- `workspaces`+- `workspaces_family`+- `workspaces_family_amazon_workspaces`+- `workspaces_family_amazon_workspaces_core`+- `workspaces_thin_client`+- `workspaces_workspaces_web`+- `x1_instance`+- `x1_instance2`+- `x1e_instance`+- `xray`+- `z1d_instance`diff --git a/skill/flow-skill/references/shape-libraries/azure2.md b/skill/flow-skill/references/shape-libraries/azure2.mdnew file mode 100644index 0000000..ce1d46c--- /dev/null+++ b/skill/flow-skill/references/shape-libraries/azure2.md@@ -0,0 +1,431 @@+# azure2++**Type:** SVG images+**Path:** `img/lib/azure2/`++## Usage++```xml+<mxCell value="label" style="image;aspect=fixed;image=img/lib/azure2/compute/Virtual_Machine.svg;verticalLabelPosition=bottom;verticalAlign=top;align=center;" vertex="1" parent="1">+ <mxGeometry x="0" y="0" width="60" height="60" as="geometry" />+</mxCell>+```++## Shapes (648)++Shapes are organized by category: `azure2/{category}/{shape}.svg`++### ai_machine_learning (30)++- `AI_Studio`+- `Anomaly_Detector`+- `Azure_Applied_AI`+- `Azure_Experimentation_Studio`+- `Azure_Object_Understanding`+- `Azure_OpenAI`+- `Batch_AI`+- `Bonsai`+- `Bot_Services`+- `Cognitive_Services`+- `Cognitive_Services_Decisions`+- `Computer_Vision`+- `Content_Moderators`+- `Content_Safety`+- `Custom_Vision`+- `Face_APIs`+- `Form_Recognizers`+- `Genomics`+- `Immersive_Readers`+- `Language_Services`+- `Language_Understanding`+- `Machine_Learning`+- `Machine_Learning_Studio_Classic_Web_Services`+- `Machine_Learning_Studio_Web_Service_Plans`+- `Machine_Learning_Studio_Workspaces`+- `Personalizers`+- `QnA_Makers`+- `Serverless_Search`+- `Speech_Services`+- `Translator_Text`++### analytics (14)++- `Analysis_Services`+- `Azure_Databricks`+- `Azure_Synapse_Analytics`+- `Azure_Workbooks`+- `Data_Lake_Analytics`+- `Data_Lake_Store_Gen1`+- `Endpoint_Analytics`+- `Event_Hub_Clusters`+- `Event_Hubs`+- `HD_Insight_Clusters`+- `Log_Analytics_Workspaces`+- `Power_BI_Embedded`+- `Power_Platform`+- `Stream_Analytics_Jobs`++### app_services (9)++- `API_Management_Services`+- `App_Service_Certificates`+- `App_Service_Domains`+- `App_Service_Environments`+- `App_Service_Plans`+- `App_Services`+- `CDN_Profiles`+- `Notification_Hubs`+- `Search_Services`++### compute (38)++- `App_Services`+- `Application_Group`+- `Automanaged_VM`+- `Availability_Sets`+- `Azure_Compute_Galleries`+- `Azure_Spring_Cloud`+- `Batch_Accounts`+- `Cloud_Services_Classic`+- `Container_Instances`+- `Container_Services_Deprecated`+- `Disk_Encryption_Sets`+- `Disks`+- `Disks_Classic`+- `Disks_Snapshots`+- `Function_Apps`+- `Host_Groups`+- `Host_Pools`+- `Hosts`+- `Image_Definitions`+- `Image_Templates`+- `Image_Versions`+- `Images`+- `Kubernetes_Services`+- `Maintenance_Configuration`+- `Managed_Service_Fabric`+- `Mesh_Applications`+- `Metrics_Advisor`+- `OS_Images_Classic`+- `Restore_Points`+- `Restore_Points_Collections`+- `Service_Fabric_Clusters`+- `Shared_Image_Galleries`+- `VM_Images_Classic`+- `VM_Scale_Sets`+- `Virtual_Machine`+- `Virtual_Machines_Classic`+- `Workspaces`+- `Workspaces2`++### containers (7)++- `App_Services`+- `Azure_Red_Hat_OpenShift`+- `Batch_Accounts`+- `Container_Instances`+- `Container_Registries`+- `Kubernetes_Services`+- `Service_Fabric_Clusters`++### databases (27)++- `Azure_Cosmos_DB`+- `Azure_Data_Explorer_Clusters`+- `Azure_Database_MariaDB_Server`+- `Azure_Database_Migration_Services`+- `Azure_Database_MySQL_Server`+- `Azure_Database_PostgreSQL_Server`+- `Azure_Database_PostgreSQL_Server_Group`+- `Azure_Purview_Accounts`+- `Azure_SQL`+- `Azure_SQL_Edge`+- `Azure_SQL_Server_Stretch_Databases`+- `Azure_SQL_VM`+- `Azure_Synapse_Analytics`+- `Cache_Redis`+- `Data_Factory`+- `Elastic_Job_Agents`+- `Instance_Pools`+- `Managed_Database`+- `Oracle_Database`+- `SQL_Data_Warehouses`+- `SQL_Database`+- `SQL_Elastic_Pools`+- `SQL_Managed_Instance`+- `SQL_Server`+- `SQL_Server_Registries`+- `SSIS_Lift_And_Shift_IR`+- `Virtual_Clusters`++### identity (35)++- `AAD_Licenses`+- `Active_Directory_Connect_Health`+- `Active_Directory_Connect_Health2`+- `Administrative_Units`+- `App_Registrations`+- `Azure_AD_B2C`+- `Azure_AD_B2C2`+- `Azure_AD_Domain_Services`+- `Azure_AD_Identity_Protection`+- `Azure_AD_Privilege_Identity_Management`+- `Azure_Active_Directory`+- `Azure_Information_Protection`+- `Custom_Azure_AD_Roles`+- `Enterprise_Applications`+- `Entra_Connect`+- `Entra_Domain_Services`+- `Entra_Global_Secure_Access`+- `Entra_ID_Protection`+- `Entra_Internet_Access`+- `Entra_Managed_Identities`+- `Entra_Private_Access`+- `Entra_Privileged_Identity_Management`+- `Entra_Verified_ID`+- `External_Identities`+- `Groups`+- `Identity_Governance`+- `Managed_Identities`+- `Multi_Factor_Authentication`+- `PIM`+- `Security`+- `Tenant_Properties`+- `User_Settings`+- `Users`+- `Verifiable_Credentials`+- `Verification_As_A_Service`++### networking (51)++- `ATM_Multistack`+- `Application_Gateway_Containers`+- `Application_Gateways`+- `Azure_Communications_Gateway`+- `Azure_Firewall_Manager`+- `Azure_Firewall_Policy`+- `Bastions`+- `CDN_Profiles`+- `Connections`+- `DDoS_Protection_Plans`+- `DNS_Multistack`+- `DNS_Private_Resolver`+- `DNS_Security_Policy`+- `DNS_Zones`+- `ExpressRoute_Circuits`+- `Firewalls`+- `Front_Doors`+- `IP_Address_manager`+- `IP_Groups`+- `Load_Balancer_Hub`+- `Load_Balancers`+- `Local_Network_Gateways`+- `NAT`+- `Network_Interfaces`+- `Network_Security_Groups`+- `Network_Watcher`+- `On_Premises_Data_Gateways`+- `Private_Endpoint`+- `Private_Link`+- `Private_Link_Hub`+- `Private_Link_Service`+- `Proximity_Placement_Groups`+- `Public_IP_Addresses`+- `Public_IP_Addresses_Classic`+- `Public_IP_Prefixes`+- `Reserved_IP_Addresses_Classic`+- `Resource_Management_Private_Link`+- `Route_Filters`+- `Route_Tables`+- `Service_Endpoint_Policies`+- `Spot_VM`+- `Spot_VMSS`+- `Subnet`+- `Traffic_Manager_Profiles`+- `Virtual_Network_Gateways`+- `Virtual_Networks`+- `Virtual_Networks_Classic`+- `Virtual_Router`+- `Virtual_WAN_Hub`+- `Virtual_WANs`+- `Web_Application_Firewall_Policies_WAF`++### security (14)++- `Application_Security_Groups`+- `Azure_AD_Risky_Signins`+- `Azure_AD_Risky_Users`+- `Azure_Defender`+- `Azure_Sentinel`+- `Conditional_Access`+- `Detonation`+- `ExtendedSecurityUpdates`+- `Identity_Secure_Score`+- `Key_Vaults`+- `Keys`+- `MS_Defender_EASM`+- `Multifactor_Authentication`+- `Security_Center`++### storage (17)++- `Azure_Fileshare`+- `Azure_HCP_Cache`+- `Azure_NetApp_Files`+- `Azure_Stack_Edge`+- `Data_Box`+- `Data_Box_Edge`+- `Data_Lake_Storage_Gen1`+- `Data_Share_Invitations`+- `Data_Shares`+- `Import_Export_Jobs`+- `Recovery_Services_Vaults`+- `StorSimple_Data_Managers`+- `StorSimple_Device_Managers`+- `Storage_Accounts`+- `Storage_Accounts_Classic`+- `Storage_Explorer`+- `Storage_Sync_Services`++### general (98)++- `All_Resources`+- `Backlog`+- `Biz_Talk`+- `Blob_Block`+- `Blob_Page`+- `Branch`+- `Browser`+- `Bug`+- `Builds`+- `Cache`+- `Code`+- `Commit`+- `Controls`+- `Controls_Horizontal`+- `Cost_Alerts`+- `Cost_Analysis`+- `Cost_Budgets`+- `Cost_Management`+- `Cost_Management_and_Billing`+- `Counter`+- `Cubes`+- `Dashboard`+- `Dashboard2`+- `Dev_Console`+- `Download`+- `Error`+- `Extensions`+- `FTP`+- `File`+- `Files`+- `Folder_Blank`+- `Folder_Website`+- `Free_Services`+- `Gear`+- `Globe`+- `Globe_Error`+- `Globe_Success`+- `Globe_Warning`+- `Guide`+- `Heart`+- `Help_and_Support`+- `Image`+- `Information`+- `Input_Output`+- `Journey_Hub`+- `Launch_Portal`+- `Learn`+- `Load_Test`+- `Location`+- `Log_Streaming`+- `Management_Groups`+- `Management_Portal`+- `Marketplace`+- `Media`+- `Media_File`+- `Mobile`+- `Mobile_Engagement`+- `Module`+- `Power`+- `Power_Up`+- `Powershell`+- `Preview`+- `Preview_Features`+- `Process_Explorer`+- `Production_Ready_Database`+- `Quickstart_Center`+- `Recent`+- `Reservations`+- `Resource_Explorer`+- `Resource_Group_List`+- `Resource_Groups`+- `Resource_Linked`+- `SSD`+- `Scale`+- `Scheduler`+- `Search`+- `Search_Grid`+- `Server_Farm`+- `Service_Bus`+- `Service_Health`+- `Storage_Azure_Files`+- `Storage_Container`+- `Storage_Queue`+- `Subscriptions`+- `TFS_VC_Repository`+- `Table`+- `Tag`+- `Tags`+- `Templates`+- `Toolbox`+- `Troubleshoot`+- `Versions`+- `Web_Slots`+- `Web_Test`+- `Website_Power`+- `Website_Staging`+- `Workbooks`+- `Workflow`++### other (149)++(See draw.io for complete list of 149 shapes in the "other" category)++Selected shapes:+- `Azure_Backup_Center`+- `Azure_Chaos_Studio`+- `Azure_Cloud_Shell`+- `Azure_Communication_Services`+- `Azure_Deployment_Environments`+- `Azure_Load_Testing`+- `Azure_Monitor_Dashboard`+- `Azure_Network_Manager`+- `Azure_Orbital`+- `Azure_Sphere`+- `Azure_Storage_Mover`+- `Grafana`+- `Kubernetes_Fleet_Manager`+- `SSH_Keys`++### Additional Categories++- **azure_ecosystem** (3): Applens, Azure_Hybrid_Center, Collaborative_Service+- **azure_stack** (8): Azure_Stack, Capacity, Infrastructure_Backup, Multi_Tenancy, Offers, Plans, Updates, User_Subscriptions+- **azure_vmware_solution** (1): AVS+- **blockchain** (6): ABS_Member, Azure_Blockchain_Service, Azure_Token_Service, Blockchain_Applications, Consortium, Outbound_Connection+- **cxp** (2): Elixir, Elixir_Purple+- **devops** (10): API_Connections, Application_Insights, Azure_DevOps, Change_Analysis, CloudTest, Code_Optimization, DevOps_Starter, DevTest_Labs, Lab_Accounts, Lab_Services+- **hybrid_multicloud** (5): Azure_Operator_5G_Core, Azure_Operator_Insights, Azure_Operator_Nexus, Azure_Operator_Service_Manager, Azure_Programmable_Connectivity+- **integration** (21): API_Management_Services, App_Configuration, Azure_API_for_FHIR, Azure_Data_Catalog, Event_Grid_Domains, Event_Grid_Subscriptions, Event_Grid_Topics, Integration_Accounts, Integration_Environments, Integration_Service_Environments, Logic_Apps, Logic_Apps_Custom_Connector, Partner_Namespace, Partner_Registration, Partner_Topic, Relays, SQL_Data_Warehouses, SendGrid_Accounts, Service_Bus, Software_as_a_Service, System_Topic+- **internet_of_things** (3): Digital_Twins, Logic_Apps, Time_Series_Insights_Access_Policies+- **intune** (17): Azure_AD_Roles_and_Administrators, Client_Apps, Device_Compliance, Device_Configuration, Device_Enrollment, Device_Security_Apple, Device_Security_Google, Device_Security_Windows, Devices, Exchange_Access, Intune, Intune_For_Education, Mindaro, Security_Baselines, Software_Updates, Tenant_Status, eBooks+- **iot** (19): Azure_IoT_Operations, Azure_Maps_Accounts, Azure_Stack_HCI_Sizer, Device_Provisioning_Services, Digital_Twins, Event_Hubs, Function_Apps, Industrial_IoT, IoT_Central_Applications, IoT_Edge, IoT_Hub, Logic_Apps, Notification_Hubs, Stack_HCI_Premium, Stream_Analytics_Jobs, Time_Series_Data_Sets, Time_Series_Insights_Environments, Time_Series_Insights_Event_Sources, Windows10_Core_Services+- **management_governance** (32): Activity_Log, Advisor, Alerts, Application_Insights, Arc_Machines, Automation_Accounts, Azure_Arc, Azure_Lighthouse, Blueprints, Compliance, Cost_Management_and_Billing, Customer_Lockbox_for_MS_Azure, Diagnostics_Settings, Education, Log_Analytics_Workspaces, MachinesAzureArc, Managed_Applications_Center, Managed_Desktop, Metrics, Monitor, My_Customers, Operation_Log_Classic, Policy, Recovery_Services_Vaults, Resource_Graph_Explorer, Resources_Provider, Scheduler_Job_Collections, Service_Catalog_MAD, Service_Providers, Solutions, Universal_Print, User_Privacy+- **menu** (1): Keys+- **migrate** (5): Azure_Migrate, Cost_Management_and_Billing, Data_Box, Data_Box_Edge, Recovery_Services_Vaults+- **mixed_reality** (2): Remote_Rendering, Spatial_Anchor_Accounts+- **monitor** (1): SAP_Azure_Monitor+- **power_platform** (9): AIBuilder, CopilotStudio, Dataverse, PowerApps, PowerAutomate, PowerBI, PowerFx, PowerPages, PowerPlatform+- **preview** (9): Azure_Cloud_Shell, Azure_Sphere, Azure_Workbooks, IoT_Edge, Private_Link_Hub, RTOS, Static_Apps, Time_Series_Data_Sets, Web_Environment+- **web** (5): API_Center, App_Space, Azure_Media_Service, Notification_Hub_Namespaces, SignalRdiff --git a/skill/flow-skill/references/shape-libraries/basic.md b/skill/flow-skill/references/shape-libraries/basic.mdnew file mode 100644index 0000000..9f73040--- /dev/null+++ b/skill/flow-skill/references/shape-libraries/basic.md@@ -0,0 +1,48 @@+# basic++**Type:** mxgraph shapes+**Prefix:** `mxgraph.basic`++## Usage++```xml+<mxCell value="label" style="shape=mxgraph.basic.{shape};fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="1">+ <mxGeometry x="0" y="0" width="60" height="60" as="geometry" />+</mxCell>+```++++## Shapes (31)++- `4_point_star`+- `6_point_star`+- `8_point_star`+- `banner`+- `cloud_callout`+- `cloud_rect`+- `cone`+- `cross`+- `document`+- `flash`+- `half_circle`+- `heart`+- `loud_callout`+- `moon`+- `mxgraph.basic`+- `no_symbol`+- `octagon`+- `orthogonal_triangle`+- `oval_callout`+- `parallelepiped`+- `pentagon`+- `pointed_oval`+- `rectangular_callout`+- `rounded_rectangular_callout`+- `smiley`+- `star`+- `sun`+- `tick`+- `trapezoid`+- `wave`+- `x`diff --git a/skill/flow-skill/references/shape-libraries/bpmn.md b/skill/flow-skill/references/shape-libraries/bpmn.mdnew file mode 100644index 0000000..6f9117e--- /dev/null+++ b/skill/flow-skill/references/shape-libraries/bpmn.md@@ -0,0 +1,60 @@+# bpmn++**Type:** mxgraph shapes+**Prefix:** `mxgraph.bpmn`++## Usage++```xml+<mxCell value="label" style="shape=mxgraph.bpmn.shape;symbol=message;outline=throwing;" vertex="1" parent="1">+ <mxGeometry x="0" y="0" width="60" height="60" as="geometry" />+</mxCell>+```++## Parameters++- `outline` - Event type: `start`, `end`, `catching`, `throwing`, `none`+- `symbol` - Icon inside: `message`, `timer`, `error`, `cancel`, `compensation`, `link`, `terminate`, `general`, `multiple`, `rule`++## Shapes (40)++- `ad_hoc`+- `business_rule_task`+- `cancel_end`+- `cancel_intermediate`+- `compensation`+- `compensation_end`+- `compensation_intermediate`+- `error_end`+- `error_intermediate`+- `gateway`+- `gateway_and`+- `gateway_complex`+- `gateway_or`+- `gateway_xor_(data)`+- `gateway_xor_(event)`+- `general_end`+- `general_intermediate`+- `general_start`+- `link_end`+- `link_intermediate`+- `link_start`+- `loop`+- `loop_marker`+- `manual_task`+- `message_end`+- `message_intermediate`+- `message_start`+- `multiple_end`+- `multiple_instances`+- `multiple_intermediate`+- `multiple_start`+- `mxgraph.bpmn`+- `rule_intermediate`+- `rule_start`+- `script_task`+- `service_task`+- `terminate`+- `timer_intermediate`+- `timer_start`+- `user_task`diff --git a/skill/flow-skill/references/shape-libraries/cabinets.md b/skill/flow-skill/references/shape-libraries/cabinets.mdnew file mode 100644index 0000000..553af7d--- /dev/null+++ b/skill/flow-skill/references/shape-libraries/cabinets.md@@ -0,0 +1,71 @@+# cabinets++**Type:** mxgraph shapes+**Prefix:** `mxgraph.cabinets`++## Usage++```xml+<mxCell value="label" style="shape=mxgraph.cabinets.{shape};" vertex="1" parent="1">+ <mxGeometry x="0" y="0" width="60" height="60" as="geometry" />+</mxCell>+```++++## Shapes (54)++- `auxiliary_contact_contactor_1_32a`+- `auxiliary_contact_contactor_32_125a`+- `cb_1p`+- `cb_1p_x10`+- `cb_2p`+- `cb_2p_x10`+- `cb_3p`+- `cb_3p_x5`+- `cb_4p`+- `cb_4p_x5`+- `cb_auxiliary_contact`+- `contactor_125_400a`+- `contactor_1_32a`+- `contactor_32_125a`+- `din_rail`+- `distribution_block_4p_125a_11_connections`+- `distribution_block_4p_125a_11_connections_2`+- `mccb_25_63a_3p`+- `mccb_25_63a_4p`+- `mccb_63_250a_3p`+- `mccb_63_250a_4p`+- `motor_cb_125_400a`+- `motor_cb_1_32a`+- `motor_cb_32_125a`+- `motor_protection_cb`+- `motor_starter_125_400a`+- `motor_starter_1_32a`+- `motor_starter_32_125a`+- `motorized_switch_3p`+- `motorized_switch_4p`+- `mxgraph.cabinets`+- `overcurrent_relay_125_400a`+- `overcurrent_relay_1_32a`+- `overcurrent_relay_32_125a`+- `plugin_relay_1`+- `plugin_relay_2`+- `residual_current_device_2p`+- `residual_current_device_4p`+- `surge_protection_1p`+- `surge_protection_2p`+- `surge_protection_3p`+- `surge_protection_4p`+- `terminal_40mm2`+- `terminal_40mm2_x10`+- `terminal_4_6mm2`+- `terminal_4_6mm2_x10`+- `terminal_4mm2`+- `terminal_4mm2_x10`+- `terminal_50mm2`+- `terminal_50mm2_x10`+- `terminal_6_25mm2`+- `terminal_6_25mm2_x10`+- `terminal_75mm2`+- `terminal_75mm2_x10`diff --git a/skill/flow-skill/references/shape-libraries/cisco19.md b/skill/flow-skill/references/shape-libraries/cisco19.mdnew file mode 100644index 0000000..72ed636--- /dev/null+++ b/skill/flow-skill/references/shape-libraries/cisco19.md@@ -0,0 +1,250 @@+# cisco19++**Type:** mxgraph shapes+**Prefix:** `mxgraph.cisco19`++## Usage++```xml+<mxCell value="label" style="shape=mxgraph.cisco19.rect;prIcon={shape};fillColor=#00bceb;strokeColor=none;verticalLabelPosition=bottom;verticalAlign=top;align=center;" vertex="1" parent="1">+ <mxGeometry x="0" y="0" width="60" height="60" as="geometry" />+</mxCell>+```++++## Shapes (233)++- `3g_4g_indicator`+- `6500_vss`+- `6500_vss2`+- `access_control_and_trustsec`+- `aci`+- `aci2`+- `acibg`+- `acs`+- `ad_decoder`+- `ad_encoder`+- `analysis_correlation`+- `anomaly_detection`+- `anti_malware`+- `anti_malware2`+- `appnav`+- `asa_5500`+- `asr_1000`+- `asr_9000`+- `avc_application_visibility_control`+- `avc_application_visibility_control2`+- `bg1`+- `bg10`+- `bg2`+- `bg3`+- `bg4`+- `bg5`+- `bg6`+- `bg7`+- `bg8`+- `bg9`+- `blade_server`+- `branch`+- `branch2`+- `camera`+- `camera2`+- `cell_phone`+- `cell_phone2`+- `cisco_15800`+- `cisco_dna`+- `cisco_dna_center`+- `cisco_meetingplace_express`+- `cisco_security_manager`+- `cisco_unified_contact_center_enterprise_and_hosted`+- `cisco_unified_presence_service`+- `clock`+- `cloud`+- `cloud2`+- `cognitive`+- `collab1`+- `collab2`+- `collab3`+- `collab4`+- `communications_manager`+- `contact_center_express`+- `content_recording_streaming_server`+- `content_router`+- `csr_1000v`+- `da_decoder`+- `da_encoder`+- `data_center`+- `data_center2`+- `database_relational`+- `dns_server`+- `dns_server2`+- `dual_mode_access_point`+- `email_security`+- `fabric_interconnect`+- `fibre_channel_director_mds_9000`+- `fibre_channel_fabric_switch`+- `firewall`+- `flow_analytics`+- `flow_analytics2`+- `flow_collector`+- `h323`+- `handheld`+- `handheld2`+- `hdtv`+- `hdtv2`+- `home_office`+- `home_office2`+- `host_based_security`+- `hypervisor`+- `immersive_telepresence_endpoint`+- `ip_ip_gateway`+- `ip_phone`+- `ip_phone2`+- `ip_telephone_router`+- `ips_ids`+- `ironport`+- `ise`+- `joystick_keyboard`+- `joystick_keyboard2`+- `key`+- `key2`+- `l2_modular`+- `l2_modular2`+- `l2_switch`+- `l2_switch_with_dual_supervisor`+- `l3_modular`+- `l3_modular2`+- `l3_modular3`+- `l3_switch`+- `l3_switch_with_dual_supervisor`+- `laptop`+- `laptop2`+- `laptop_video_client`+- `laptop_video_client2`+- `layer3_nexus_5k_switch`+- `ldap`+- `ldap2`+- `load_balancer`+- `lock`+- `lock2`+- `media_server`+- `meeting_scheduling_and_management_server`+- `mesh_access_point`+- `monitor`+- `monitoring`+- `multipoint_meeting_server`+- `mxgraph.cisco19`+- `nac_appliance`+- `nam_virtual_service_blade`+- `net_mgmt_appliance`+- `netflow_router`+- `netflow_router2`+- `netflow_router3`+- `next_generation_intrusion_prevention_system`+- `nexus_1010`+- `nexus_1k`+- `nexus_1kv_vsm`+- `nexus_2000_10ge`+- `nexus_2k`+- `nexus_3k`+- `nexus_4k`+- `nexus_5k`+- `nexus_5k_with_integrated_vsm`+- `nexus_7k`+- `nexus_9300`+- `nexus_9500`+- `operations_manager`+- `phone_polycom`+- `phone_polycom2`+- `policy_configuration`+- `pos`+- `pos2`+- `posture_assessment`+- `primary_codec`+- `printer`+- `printer2`+- `router`+- `router_with_firewall`+- `router_with_firewall2`+- `router_with_voice`+- `rps`+- `secondary_codec`+- `secure_catalyst_switch_color`+- `secure_catalyst_switch_color2`+- `secure_catalyst_switch_color3`+- `secure_catalyst_switch_subdued`+- `secure_catalyst_switch_subdued2`+- `secure_endpoint_pc`+- `secure_endpoint_pc2`+- `secure_endpoints`+- `secure_endpoints2`+- `secure_router`+- `secure_server`+- `secure_server2`+- `secure_switch`+- `security_management`+- `server`+- `server2`+- `service_ready_engine`+- `set_top`+- `set_top2`+- `shield`+- `ssl_terminator`+- `stealthwatch_management_console_smc`+- `stealthwatch_management_console_smc2`+- `storage`+- `surveillance_camera`+- `surveillance_camera2`+- `tablet`+- `tablet2`+- `telepresence_endpoint`+- `telepresence_endpoint_twin_data_display`+- `telepresence_exchange`+- `threat_intelligence`+- `transcoder`+- `ucs_5108_blade_chassis`+- `ucs_c_series_server`+- `ucs_express`+- `unity`+- `upc_unified_personal_communicator`+- `upc_unified_personal_communicator2`+- `ups`+- `user`+- `user2`+- `vbond`+- `video_analytics`+- `video_call_server`+- `video_gateway`+- `virtual_desktop_service`+- `virtual_matrix_switch`+- `virtual_private_network`+- `virtual_private_network2`+- `virtual_private_network_connector`+- `vmanage`+- `vpn_concentrator`+- `vsmart`+- `vts`+- `vts2`+- `web_application_firewall`+- `web_reputation_filtering`+- `web_reputation_filtering_2`+- `web_security`+- `web_security_services`+- `web_security_services2`+- `webex`+- `wifi_indicator`+- `wireless_access_point`+- `wireless_access_point2`+- `wireless_bridge`+- `wireless_bridge2`+- `wireless_connector`+- `wireless_intrusion_prevention`+- `wireless_lan_controller`+- `wireless_location_appliance`+- `wireless_router`+- `workgroup_switch`+- `workstation`+- `workstation2`+- `x509_certificate`+- `x509_certificate2`diff --git a/skill/flow-skill/references/shape-libraries/citrix.md b/skill/flow-skill/references/shape-libraries/citrix.mdnew file mode 100644index 0000000..2fa5174--- /dev/null+++ b/skill/flow-skill/references/shape-libraries/citrix.md@@ -0,0 +1,115 @@+# citrix++**Type:** mxgraph shapes+**Prefix:** `mxgraph.citrix`++## Usage++```xml+<mxCell value="label" style="shape=mxgraph.citrix.{shape};fillColor=#00A4E4;strokeColor=none;verticalLabelPosition=bottom;verticalAlign=top;align=center;" vertex="1" parent="1">+ <mxGeometry x="0" y="0" width="60" height="60" as="geometry" />+</mxCell>+```++++## Shapes (98)++- `1u_2u_server`+- `access_card`+- `branch_repeater`+- `browser`+- `cache_server`+- `calendar`+- `cell_phone`+- `chassis`+- `citrix_hdx`+- `citrix_logo`+- `cloud`+- `command_center`+- `database`+- `database_server`+- `datacenter`+- `desktop`+- `desktop_web`+- `dhcp_server`+- `directory_server`+- `dns_server`+- `document`+- `edgesight_server`+- `file_server`+- `firewall`+- `ftp_server`+- `geolocation_database`+- `globe`+- `goto_meeting`+- `government`+- `home_office`+- `hq_enterprise`+- `inspection`+- `ip_phone`+- `kiosk`+- `laptop_1`+- `laptop_2`+- `license_server`+- `merchandising_server`+- `middleware`+- `mxgraph.citrix`+- `netscaler_gateway`+- `netscaler_mpx`+- `netscaler_sdx`+- `netscaler_vpx`+- `pbx_server`+- `pda`+- `podio`+- `printer`+- `process`+- `provisioning_server`+- `proxy_server`+- `radius_server`+- `remote_office`+- `reporting`+- `role_appcontroller`+- `role_applications`+- `role_cloudbridge`+- `role_desktops`+- `role_load_testing_controller`+- `role_load_testing_launcher`+- `role_receiver`+- `role_repeater`+- `role_secure_access`+- `role_security`+- `role_services`+- `role_storefront`+- `role_storefront_services`+- `role_synchronizer`+- `role_xenmobile`+- `role_xenmobile_device_manager`+- `router`+- `security`+- `sharefile`+- `site`+- `smtp_server`+- `storefront_services`+- `switch`+- `tablet_1`+- `tablet_2`+- `thin_client`+- `tower_server`+- `user_control`+- `users`+- `web_server`+- `web_service`+- `worxenroll`+- `worxhome`+- `worxmail`+- `worxweb`+- `xenapp_server`+- `xenapp_services`+- `xenapp_web`+- `xencenter`+- `xenclient`+- `xenclient_synchronizer`+- `xendesktop_server`+- `xenmobile`+- `xenserver`diff --git a/skill/flow-skill/references/shape-libraries/electrical.md b/skill/flow-skill/references/shape-libraries/electrical.mdnew file mode 100644index 0000000..ab41c00--- /dev/null+++ b/skill/flow-skill/references/shape-libraries/electrical.md@@ -0,0 +1,50 @@+# electrical++**Type:** mxgraph shapes+**Prefix:** `mxgraph.electrical`++## Usage++```xml+<mxCell value="label" style="shape=mxgraph.electrical.resistors.resistor_1;" vertex="1" parent="1">+ <mxGeometry x="0" y="0" width="60" height="20" as="geometry" />+</mxCell>+```++Shapes are organized by category: `mxgraph.electrical.{category}.{shape}`++## Categories++### resistors+- `resistor_1`+- `resistor_2`++### capacitors+- `capacitor_1`+- `capacitor_3`++### inductors+- `inductor_3`+- `transformer_1`++### diodes+- `diode`+- `zener_diode_1`++### transistors+- `npn_transistor_1`+- `pnp_transistor_1`++### mosfets1+- `n-channel_mosfet_1`+- `p-channel_mosfet_1`++### logic_gates+- `logic_gate`+- `dual_inline_ic`++### electro-mechanical+- `singleSwitch`+- `pushbutton`++(See draw.io Electrical shape library for complete list)diff --git a/skill/flow-skill/references/shape-libraries/floorplan.md b/skill/flow-skill/references/shape-libraries/floorplan.mdnew file mode 100644index 0000000..ab67dd1--- /dev/null+++ b/skill/flow-skill/references/shape-libraries/floorplan.md@@ -0,0 +1,62 @@+# floorplan++**Type:** mxgraph shapes+**Prefix:** `mxgraph.floorplan`++## Usage++```xml+<mxCell value="label" style="shape=mxgraph.floorplan.{shape};fillColor=#ffffff;strokeColor=#000000;" vertex="1" parent="1">+ <mxGeometry x="0" y="0" width="60" height="60" as="geometry" />+</mxCell>+```++++## Shapes (45)++- `bathtub`+- `bathtub2`+- `bed_double`+- `bed_single`+- `bookcase`+- `chair`+- `copier`+- `couch`+- `crt_tv`+- `desk_corner`+- `desk_corner_2`+- `dresser`+- `drying_machine`+- `elevator`+- `fireplace`+- `flat_tv`+- `floor_lamp`+- `laptop`+- `mxgraph.floorplan`+- `office_chair`+- `piano`+- `plant`+- `printer`+- `range_1`+- `range_2`+- `refrigerator`+- `shower`+- `shower2`+- `sink_1`+- `sink_2`+- `sink_22`+- `sink_double`+- `sink_double2`+- `sofa`+- `spiral_stairs`+- `table`+- `table_1`+- `table_2`+- `table_3`+- `table_4`+- `table_5`+- `toilet`+- `washing_machine`+- `water_cooler`+- `workstation`diff --git a/skill/flow-skill/references/shape-libraries/flowchart.md b/skill/flow-skill/references/shape-libraries/flowchart.mdnew file mode 100644index 0000000..9c8e4a8--- /dev/null+++ b/skill/flow-skill/references/shape-libraries/flowchart.md@@ -0,0 +1,52 @@+# flowchart++**Type:** mxgraph shapes+**Prefix:** `mxgraph.flowchart`++## Usage++```xml+<mxCell value="label" style="shape=mxgraph.flowchart.{shape};fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">+ <mxGeometry x="0" y="0" width="60" height="60" as="geometry" />+</mxCell>+```++++## Shapes (35)++- `annotation_1`+- `annotation_2`+- `card`+- `collate`+- `data`+- `database`+- `decision`+- `delay`+- `direct_data`+- `display`+- `document`+- `extract_or_measurement`+- `internal_storage`+- `loop_limit`+- `manual_input`+- `manual_operation`+- `merge_or_storage`+- `multi-document`+- `mxgraph.flowchart`+- `off-page_reference`+- `on-page_reference`+- `or`+- `paper_tape`+- `parallel_mode`+- `predefined_process`+- `preparation`+- `process`+- `sequential_data`+- `sort`+- `start_1`+- `start_2`+- `stored_data`+- `summing_function`+- `terminator`+- `transfer`diff --git a/skill/flow-skill/references/shape-libraries/fluidpower.md b/skill/flow-skill/references/shape-libraries/fluidpower.mdnew file mode 100644index 0000000..58abfa2--- /dev/null+++ b/skill/flow-skill/references/shape-libraries/fluidpower.md@@ -0,0 +1,264 @@+# fluidpower++**Type:** mxgraph shapes+**Prefix:** `mxgraph.fluid_power`++## Usage++```xml+<mxCell value="label" style="shape=mxgraph.fluid_power.{shape};fillColor=strokeColor;" vertex="1" parent="1">+ <mxGeometry x="0" y="0" width="60" height="60" as="geometry" />+</mxCell>+```++Shapes are named like x10010, x10020, etc.++## Shapes (247)++- `mxgraph.fluid_power`+- `x10010`+- `x10020`+- `x10030`+- `x10040`+- `x10050`+- `x10060`+- `x10070`+- `x10080`+- `x10090`+- `x10100`+- `x10110`+- `x10120`+- `x10130`+- `x10140`+- `x10150`+- `x10160`+- `x10170`+- `x10180`+- `x10190`+- `x10200`+- `x10210`+- `x10220`+- `x10230`+- `x10240`+- `x10250`+- `x10260`+- `x10270`+- `x10280`+- `x10290`+- `x10300`+- `x10310`+- `x10320`+- `x10330`+- `x10340`+- `x10350`+- `x10360`+- `x10370`+- `x10380`+- `x10390`+- `x10400`+- `x10410`+- `x10420`+- `x10430`+- `x10440`+- `x10441`+- `x10442`+- `x10450`+- `x10460`+- `x10470`+- `x10480`+- `x10490`+- `x10500`+- `x10510`+- `x10520`+- `x10530`+- `x10540`+- `x10550`+- `x10560`+- `x10570`+- `x10580`+- `x10590`+- `x10600`+- `x10610`+- `x10620`+- `x10630`+- `x10640`+- `x10650`+- `x10660`+- `x10670`+- `x10680`+- `x10690`+- `x10700`+- `x10710`+- `x10720`+- `x10730`+- `x10740`+- `x10750`+- `x10760`+- `x10770`+- `x10780`+- `x10790`+- `x10800`+- `x10810`+- `x10820`+- `x10830`+- `x10840`+- `x10850`+- `x10860`+- `x10870`+- `x10880`+- `x10890`+- `x10900`+- `x10910`+- `x10920`+- `x10930`+- `x10940`+- `x10950`+- `x10960`+- `x10970`+- `x10980`+- `x10990`+- `x11000`+- `x11010`+- `x11020`+- `x11030`+- `x11040`+- `x11050`+- `x11060`+- `x11070`+- `x11080`+- `x11090`+- `x11100`+- `x11110`+- `x11120`+- `x11130`+- `x11140`+- `x11150`+- `x11160`+- `x11170`+- `x11180`+- `x11190`+- `x11200`+- `x11210`+- `x11220`+- `x11230`+- `x11240`+- `x11250`+- `x11260`+- `x11270`+- `x11280`+- `x11290`+- `x11300`+- `x11310`+- `x11320`+- `x11330`+- `x11340`+- `x11350`+- `x11360`+- `x11370`+- `x11380`+- `x11390`+- `x11400`+- `x11410`+- `x11420`+- `x11430`+- `x11440`+- `x11450`+- `x11460`+- `x11470`+- `x11480`+- `x11490`+- `x11500`+- `x11510`+- `x11520`+- `x11530`+- `x11540`+- `x11550`+- `x11560`+- `x11570`+- `x11580`+- `x11590`+- `x11600`+- `x11610`+- `x11620`+- `x11630`+- `x11640`+- `x11650`+- `x11660`+- `x11670`+- `x11680`+- `x11690`+- `x11700`+- `x11710`+- `x11720`+- `x11730`+- `x11740`+- `x11750`+- `x11760`+- `x11770`+- `x11780`+- `x11790`+- `x11800`+- `x11810`+- `x11820`+- `x11830`+- `x11840`+- `x11850`+- `x11860`+- `x11870`+- `x11880`+- `x11890`+- `x11900`+- `x11910`+- `x11920`+- `x11930`+- `x11940`+- `x11950`+- `x11960`+- `x11970`+- `x11980`+- `x11990`+- `x12000`+- `x12010`+- `x12020`+- `x12030`+- `x12040`+- `x12050`+- `x12060`+- `x12070`+- `x12080`+- `x12090`+- `x12100`+- `x12110`+- `x12120`+- `x12130`+- `x12140`+- `x12150`+- `x12160_detailed`+- `x12160_simplified`+- `x12170`+- `x12180`+- `x12190`+- `x12200`+- `x12210`+- `x12220`+- `x12230`+- `x12240`+- `x12250`+- `x12260`+- `x12270`+- `x12280`+- `x12290`+- `x12300`+- `x12310`+- `x12320`+- `x12330`+- `x12340`+- `x12350`+- `x12360`+- `x12370`+- `x12380`+- `x12390`+- `x12400`+- `x12410`+- `x12420`+- `x12430`diff --git a/skill/flow-skill/references/shape-libraries/gcp2.md b/skill/flow-skill/references/shape-libraries/gcp2.mdnew file mode 100644index 0000000..ceb032b--- /dev/null+++ b/skill/flow-skill/references/shape-libraries/gcp2.md@@ -0,0 +1,315 @@+# gcp2++**Type:** mxgraph shapes+**Prefix:** `mxgraph.gcp2`++## Usage++```xml+<mxCell value="label" style="shape=mxgraph.gcp2.{shape};fillColor=#4285F4;strokeColor=none;verticalLabelPosition=bottom;verticalAlign=top;align=center;" vertex="1" parent="1">+ <mxGeometry x="0" y="0" width="60" height="60" as="geometry" />+</mxCell>+```++++## Shapes (298)++- `a7_power`+- `admin_connected`+- `admob`+- `advanced_solutions_lab`+- `ai_hub`+- `anomaly_detection`+- `api_analytics`+- `api_monetization`+- `apigee_api_platform`+- `apigee_sense`+- `app_engine`+- `app_engine_icon`+- `application`+- `application_system`+- `arrow_cycle`+- `arrows_system`+- `aspect_ratio`+- `automl_natural_language`+- `automl_tables`+- `automl_translation`+- `automl_video_intelligence`+- `automl_vision`+- `avere`+- `beacon`+- `beyondcorp`+- `big_query`+- `bigquery`+- `biomedical_beaker`+- `biomedical_test_tube`+- `biomedical_trio`+- `blank`+- `blue_hexagon`+- `bucket`+- `bucket_scale`+- `calculator`+- `campaign_manager`+- `capabilities`+- `certified_industry_standard`+- `check`+- `check_2`+- `check_available`+- `check_scale`+- `circuit_board`+- `clock`+- `cloud`+- `cloud_apis`+- `cloud_armor`+- `cloud_automl`+- `cloud_bigtable`+- `cloud_cdn`+- `cloud_checkmark`+- `cloud_code`+- `cloud_composer`+- `cloud_computer`+- `cloud_connected_insight`+- `cloud_data_catalog`+- `cloud_data_fusion`+- `cloud_dataflow`+- `cloud_dataflow_icon`+- `cloud_datalab`+- `cloud_dataprep`+- `cloud_dataproc`+- `cloud_dataproc_icon`+- `cloud_datastore`+- `cloud_deployment_manager`+- `cloud_dns`+- `cloud_endpoints`+- `cloud_external_ip_addresses`+- `cloud_filestore`+- `cloud_firestore`+- `cloud_firewall_rules`+- `cloud_functions`+- `cloud_iam`+- `cloud_inference_api`+- `cloud_information`+- `cloud_iot_core`+- `cloud_iot_edge`+- `cloud_jobs_api`+- `cloud_load_balancing`+- `cloud_machine_learning`+- `cloud_memorystore`+- `cloud_messaging`+- `cloud_monitoring`+- `cloud_nat`+- `cloud_natural_language_api`+- `cloud_network`+- `cloud_pubsub`+- `cloud_router`+- `cloud_routes`+- `cloud_run`+- `cloud_scheduler`+- `cloud_security`+- `cloud_security_command_center`+- `cloud_security_scanner`+- `cloud_server`+- `cloud_service_mesh`+- `cloud_spanner`+- `cloud_speech_api`+- `cloud_sql`+- `cloud_storage`+- `cloud_sub_pub`+- `cloud_tasks`+- `cloud_test_lab`+- `cloud_text_to_speech`+- `cloud_tools_for_powershell`+- `cloud_tpu`+- `cloud_translation_api`+- `cloud_video_intelligence_api`+- `cloud_vision_api`+- `cloud_vpn`+- `cluster`+- `compute_engine`+- `compute_engine_2`+- `compute_engine_icon`+- `connected`+- `container_builder`+- `container_engine`+- `container_engine_icon`+- `container_optimized_os`+- `container_registry`+- `cost`+- `cost_arrows`+- `cost_savings`+- `data_access`+- `data_increase`+- `data_loss_prevention_api`+- `data_storage_cost`+- `data_studio`+- `database`+- `database_2`+- `database_3`+- `database_cycle`+- `database_speed`+- `database_uploading`+- `debugger`+- `dedicated_game_server`+- `dedicated_interconnect`+- `desktop`+- `desktop_and_mobile`+- `developer_portal`+- `dialogflow_enterprise_edition`+- `enhance_ui`+- `enhance_ui_2`+- `error_reporting`+- `external_data_center`+- `external_data_resource`+- `external_payment_form`+- `fastly`+- `files`+- `firebase`+- `folders`+- `forseti_lockup`+- `forseti_logo`+- `frontend_platform_services`+- `game`+- `gateway`+- `gateway_icon`+- `gear`+- `gear_arrow`+- `gear_chain`+- `gear_load`+- `genomics`+- `gke_on_prem`+- `globe_world`+- `google_ad_manager`+- `google_ads`+- `google_analytics`+- `google_analytics_360`+- `google_cloud_platform`+- `google_cloud_platform_lockup`+- `google_network`+- `google_network_edge_cache`+- `google_play_game_service`+- `gpu`+- `half_cloud`+- `https_load_balancer`+- `identity_aware_proxy`+- `image_services`+- `increase_cost_arrows`+- `internal_payment_authorization`+- `internet_connection`+- `istio_logo`+- `key`+- `key_management_service`+- `kubernetes_logo`+- `kubernetes_name`+- `laptop`+- `legacy_cloud`+- `legacy_cloud_2`+- `lifecycle`+- `lightbulb`+- `list`+- `live`+- `load_balancing`+- `loading`+- `loading_2`+- `loading_3`+- `lock`+- `logging`+- `logs_api`+- `management_security`+- `maps_api`+- `mem_instances`+- `memcache`+- `memory_card`+- `mobile_devices`+- `modifiers_autoscaling`+- `modifiers_custom_virtual_machine`+- `modifiers_high_cpu_machine`+- `modifiers_high_memory_machine`+- `modifiers_preemptable_vm`+- `modifiers_shared_core_machine_f1`+- `modifiers_shared_core_machine_g1`+- `modifiers_standard_machine`+- `modifiers_storage`+- `monitor`+- `monitor_2`+- `mxgraph.gcp2`+- `nat`+- `network`+- `network_load_balancer`+- `node`+- `outline_blank_1`+- `outline_blank_2`+- `outline_blank_3`+- `outline_highcomp`+- `outline_highmem`+- `partner_interconnect`+- `payment`+- `people_security_management`+- `persistent_disk`+- `persistent_disk_snapshot`+- `phone`+- `phone_android`+- `placeholder`+- `play_gear`+- `play_start`+- `prediction_api`+- `premium_network_tier`+- `primary`+- `process`+- `profiler`+- `push_notification_service`+- `recommendations_ai`+- `record`+- `replication_controller`+- `replication_controller_2`+- `replication_controller_3`+- `report`+- `repository`+- `repository_2`+- `repository_3`+- `repository_primary`+- `retail`+- `safety`+- `save`+- `scale`+- `scheduled_tasks`+- `search`+- `search_api`+- `security_key_enforcement`+- `segments`+- `segments_2`+- `segments_overlap`+- `servers_stacked`+- `service`+- `service_discovery`+- `social_media_time`+- `solution`+- `speaker`+- `speed`+- `squid_proxy`+- `stackdriver`+- `stacked_ownership`+- `standard_network_tier`+- `storage`+- `stream`+- `swap`+- `systems_check`+- `tape_record`+- `task_queues`+- `task_queues_2`+- `tensorflow_lockup`+- `tensorflow_logo`+- `thumbs_up`+- `time_clock`+- `trace`+- `traffic_director`+- `transfer_appliance`+- `users`+- `view_list`+- `virtual_file_system`+- `virtual_private_cloud`+- `visibility`+- `vpn`+- `vpn_gateway`+- `webcam`+- `website`diff --git a/skill/flow-skill/references/shape-libraries/infographic.md b/skill/flow-skill/references/shape-libraries/infographic.mdnew file mode 100644index 0000000..2a98611--- /dev/null+++ b/skill/flow-skill/references/shape-libraries/infographic.md@@ -0,0 +1,24 @@+# infographic++**Type:** mxgraph shapes+**Prefix:** `mxgraph.infographic`++## Usage++```xml+<mxCell value="label" style="html=1;shape=mxgraph.infographic.shadedCube;isoAngle=15;fillColor=#10739E;strokeColor=none;" vertex="1" parent="1">+ <mxGeometry x="0" y="0" width="60" height="60" as="geometry" />+</mxCell>+```++## Shapes++- `shadedCube` (needs `isoAngle=15;`)+- `ribbonSimple` (needs `notch1=20;notch2=20;`)+- `ribbonRolled`+- `ribbonDoubleFolded`+- `shadedTriangle`+- `shadedPyramid`+- `cylinder`+- `banner`+- `flag`diff --git a/skill/flow-skill/references/shape-libraries/kubernetes.md b/skill/flow-skill/references/shape-libraries/kubernetes.mdnew file mode 100644index 0000000..61e7a40--- /dev/null+++ b/skill/flow-skill/references/shape-libraries/kubernetes.md@@ -0,0 +1,58 @@+# kubernetes++**Type:** mxgraph shapes+**Prefix:** `mxgraph.kubernetes`++## Usage++```xml+<mxCell value="label" style="shape=mxgraph.kubernetes.icon;prIcon={shape};fillColor=#326CE5;strokeColor=none;verticalLabelPosition=bottom;verticalAlign=top;align=center;" vertex="1" parent="1">+ <mxGeometry x="0" y="0" width="60" height="60" as="geometry" />+</mxCell>+```++++## Shapes (41)++- `api`+- `c_c_m`+- `c_m`+- `c_role`+- `cm`+- `crb`+- `crd`+- `cronjob`+- `deploy`+- `ds`+- `ep`+- `etcd`+- `frame`+- `group`+- `hpa`+- `ing`+- `job`+- `k_proxy`+- `kubelet`+- `limits`+- `master`+- `mxgraph.kubernetes`+- `netpol`+- `node`+- `ns`+- `pod`+- `psp`+- `pv`+- `pvc`+- `quota`+- `rb`+- `role`+- `rs`+- `sa`+- `sc`+- `sched`+- `secret`+- `sts`+- `svc`+- `user`+- `vol`diff --git a/skill/flow-skill/references/shape-libraries/lean_mapping.md b/skill/flow-skill/references/shape-libraries/lean_mapping.mdnew file mode 100644index 0000000..811a18a--- /dev/null+++ b/skill/flow-skill/references/shape-libraries/lean_mapping.md@@ -0,0 +1,31 @@+# lean_mapping++**Type:** mxgraph shapes+**Prefix:** `mxgraph.lean_mapping`++## Usage++```xml+<mxCell value="label" style="shape=mxgraph.lean_mapping.{shape};strokeWidth=2;" vertex="1" parent="1">+ <mxGeometry x="0" y="0" width="60" height="60" as="geometry" />+</mxCell>+```++++## Shapes (14)++- `airplane_7`+- `electronic_info_flow`+- `finished_goods_to_customer`+- `go_see_production_scheduling`+- `kaizen_lightening_burst`+- `kanban_post`+- `load_leveling`+- `manual_info_flow`+- `move_by_forklift`+- `mrp_erp`+- `mxgraph.lean_mapping`+- `operator`+- `quality_problem`+- `verbal`diff --git a/skill/flow-skill/references/shape-libraries/material_design.md b/skill/flow-skill/references/shape-libraries/material_design.mdnew file mode 100644index 0000000..9dd4e7c--- /dev/null+++ b/skill/flow-skill/references/shape-libraries/material_design.md@@ -0,0 +1,367 @@+# material_design++**Type:** SVG images (Google Material Icons CDN)+**URL Pattern:** `https://fonts.gstatic.com/s/i/materialicons/{icon_name}/v6/24px.svg`++## Usage++```xml+<mxCell value="label" style="image;aspect=fixed;html=1;image=https://fonts.gstatic.com/s/i/materialicons/{icon_name}/v6/24px.svg;verticalLabelPosition=bottom;verticalAlign=top;align=center;" vertex="1" parent="1">+ <mxGeometry x="0" y="0" width="48" height="48" as="geometry" />+</mxCell>+```++Replace `{icon_name}` with any icon name from the list below.++## action (115)++- `account_balance`+- `account_balance_wallet`+- `account_box`+- `account_circle`+- `add_shopping_cart`+- `admin_panel_settings`+- `analytics`+- `arrow_right_alt`+- `article`+- `assessment`+- `assignment`+- `assignment_ind`+- `assignment_turned_in`+- `autorenew`+- `bookmark`+- `bookmark_border`+- `build`+- `calendar_month`+- `calendar_today`+- `card_giftcard`+- `check_circle`+- `check_circle_outline`+- `code`+- `contact_support`+- `credit_card`+- `dashboard`+- `date_range`+- `delete`+- `delete_forever`+- `delete_outline`+- `description`+- `dns`+- `done`+- `done_all`+- `done_outline`+- `drag_indicator`+- `event`+- `exit_to_app`+- `explore`+- `face`+- `fact_check`+- `favorite`+- `favorite_border`+- `feedback`+- `filter_alt`+- `fingerprint`+- `flight_takeoff`+- `grade`+- `help`+- `help_outline`+- `highlight_off`+- `history`+- `home`+- `info`+- `label`+- `language`+- `launch`+- `leaderboard`+- `lightbulb`+- `list`+- `lock`+- `lock_open`+- `login`+- `logout`+- `manage_accounts`+- `note_add`+- `open_in_full`+- `open_in_new`+- `paid`+- `payment`+- `pending`+- `pending_actions`+- `perm_identity`+- `pets`+- `power_settings_new`+- `preview`+- `print`+- `published_with_changes`+- `question_answer`+- `receipt`+- `reorder`+- `report_problem`+- `room`+- `savings`+- `schedule`+- `search`+- `settings`+- `shopping_bag`+- `shopping_basket`+- `shopping_cart`+- `star_rate`+- `stars`+- `store`+- `supervisor_account`+- `swap_horiz`+- `sync_alt`+- `task_alt`+- `thumb_up`+- `thumb_up_off_alt`+- `timeline`+- `tips_and_updates`+- `today`+- `touch_app`+- `trending_up`+- `update`+- `verified`+- `verified_user`+- `view_in_ar`+- `view_list`+- `visibility`+- `visibility_off`+- `watch_later`+- `work`+- `work_outline`+- `zoom_in`++## alert (4)++- `error`+- `error_outline`+- `warning`+- `warning_amber`++## av (12)++- `library_books`+- `mic`+- `pause`+- `play_arrow`+- `play_circle`+- `play_circle_filled`+- `play_circle_outline`+- `replay`+- `skip_next`+- `videocam`+- `volume_off`+- `volume_up`++## communication (13)++- `alternate_email`+- `business`+- `call`+- `chat`+- `chat_bubble_outline`+- `email`+- `forum`+- `list_alt`+- `location_on`+- `mail_outline`+- `phone`+- `qr_code_scanner`+- `vpn_key`++## content (27)++- `add`+- `add_box`+- `add_circle`+- `add_circle_outline`+- `block`+- `bolt`+- `calculate`+- `clear`+- `content_copy`+- `create`+- `filter_list`+- `flag`+- `how_to_reg`+- `insights`+- `inventory`+- `inventory_2`+- `link`+- `mail`+- `push_pin`+- `remove`+- `remove_circle`+- `remove_circle_outline`+- `reply`+- `save`+- `send`+- `sort`+- `undo`++## device (9)++- `dark_mode`+- `devices`+- `light_mode`+- `password`+- `restart_alt`+- `sell`+- `signal_cellular_alt`+- `summarize`+- `task`++## editor (9)++- `attach_file`+- `attach_money`+- `bar_chart`+- `checklist`+- `edit_note`+- `format_list_bulleted`+- `mode_edit`+- `monetization_on`+- `post_add`++## file (8)++- `cloud_upload`+- `download`+- `file_download`+- `file_upload`+- `folder`+- `folder_open`+- `grid_view`+- `upload_file`++## hardware (6)++- `computer`+- `keyboard_arrow_down`+- `keyboard_arrow_right`+- `phone_iphone`+- `security`+- `smartphone`++## image (16)++- `add_a_photo`+- `auto_awesome`+- `auto_stories`+- `circle`+- `collections`+- `edit`+- `image`+- `navigate_before`+- `navigate_next`+- `palette`+- `photo_camera`+- `picture_as_pdf`+- `receipt_long`+- `remove_red_eye`+- `timer`+- `tune`++## maps (11)++- `badge`+- `category`+- `directions_car`+- `local_fire_department`+- `local_offer`+- `local_shipping`+- `map`+- `menu_book`+- `place`+- `restaurant`+- `volunteer_activism`++## navigation (29)++- `apps`+- `arrow_back`+- `arrow_back_ios`+- `arrow_back_ios_new`+- `arrow_downward`+- `arrow_drop_down`+- `arrow_drop_up`+- `arrow_forward`+- `arrow_forward_ios`+- `arrow_right`+- `arrow_upward`+- `campaign`+- `cancel`+- `check`+- `chevron_left`+- `chevron_right`+- `close`+- `double_arrow`+- `east`+- `expand_less`+- `expand_more`+- `fullscreen`+- `menu`+- `menu_open`+- `more_horiz`+- `more_vert`+- `payments`+- `refresh`+- `unfold_more`++## notification (6)++- `account_tree`+- `event_available`+- `priority_high`+- `support_agent`+- `sync`+- `wifi`++## places (2)++- `apartment`+- `storefront`++## search (2)++- `feed`+- `manage_search`++## social (23)++- `construction`+- `emoji_emotions`+- `emoji_events`+- `engineering`+- `group`+- `group_add`+- `groups`+- `health_and_safety`+- `notifications`+- `notifications_active`+- `notifications_none`+- `people`+- `people_alt`+- `person`+- `person_add`+- `person_outline`+- `psychology`+- `public`+- `school`+- `share`+- `thumb_up_alt`+- `travel_explore`+- `water_drop`++## toggle (8)++- `check_box`+- `check_box_outline_blank`+- `radio_button_checked`+- `radio_button_unchecked`+- `star`+- `star_border`+- `star_outline`+- `toggle_on`++Total: 300 icons (top by popularity from 2100+ available)diff --git a/skill/flow-skill/references/shape-libraries/mscae.md b/skill/flow-skill/references/shape-libraries/mscae.mdnew file mode 100644index 0000000..cf95379--- /dev/null+++ b/skill/flow-skill/references/shape-libraries/mscae.md@@ -0,0 +1,22 @@+# mscae++**Type:** mxgraph shapes+**Prefix:** `mxgraph.mscae`++## Usage++```xml+<mxCell value="label" style="shape=mxgraph.mscae.cloud.azure;fillColor=#0078D4;strokeColor=none;verticalLabelPosition=bottom;verticalAlign=top;align=center;" vertex="1" parent="1">+ <mxGeometry x="0" y="0" width="60" height="60" as="geometry" />+</mxCell>+```++## Categories++Shapes are organized by category: `mscae.cloud`, `mscae.intune`, `mscae.oms`, `mscae.system_center`++- `conditional_access_exchange`+- `conditional_access_sharepoint`+- `primary_site`++(See draw.io for complete shape list within each category)diff --git a/skill/flow-skill/references/shape-libraries/network.md b/skill/flow-skill/references/shape-libraries/network.mdnew file mode 100644index 0000000..d12e183--- /dev/null+++ b/skill/flow-skill/references/shape-libraries/network.md@@ -0,0 +1,72 @@+# network++**Type:** mxgraph shapes+**Prefix:** `mxgraph.networks`++## Usage++```xml+<mxCell value="label" style="shape=mxgraph.networks.server;fillColor=#29AAE1;strokeColor=none;verticalLabelPosition=bottom;verticalAlign=top;align=center;" vertex="1" parent="1">+ <mxGeometry x="0" y="0" width="60" height="60" as="geometry" />+</mxCell>+```++## Shapes (57)++- `biometric_reader`+- `bus`+- `business_center`+- `cloud`+- `comm_link`+- `comm_link_edge`+- `community`+- `copier`+- `desktop_pc`+- `external_storage`+- `firewall`+- `gamepad`+- `hub`+- `laptop`+- `load_balancer`+- `mail_server`+- `mainframe`+- `mobile`+- `modem`+- `monitor`+- `nas_filer`+- `patch_panel`+- `phone_1`+- `phone_2`+- `printer`+- `proxy_server`+- `rack`+- `radio_tower`+- `router`+- `satellite`+- `satellite_dish`+- `scanner`+- `secured`+- `security_camera`+- `server`+- `server_storage`+- `storage`+- `supercomputer`+- `switch`+- `tablet`+- `tape_storage`+- `terminal`+- `unsecure`+- `ups_enterprise`+- `ups_small`+- `usb_stick`+- `user_female`+- `user_male`+- `users`+- `video_projector`+- `video_projector_screen`+- `virtual_pc`+- `virtual_server`+- `virus`+- `web_server`+- `wireless_hub`+- `wireless_modem`diff --git a/skill/flow-skill/references/shape-libraries/openstack.md b/skill/flow-skill/references/shape-libraries/openstack.mdnew file mode 100644index 0000000..9c719d5--- /dev/null+++ b/skill/flow-skill/references/shape-libraries/openstack.md@@ -0,0 +1,36 @@+# openstack++**Type:** mxgraph shapes+**Prefix:** `mxgraph.openstack`++## Usage++```xml+<mxCell value="label" style="shape=mxgraph.openstack.{shape};fillColor=#3F51B5;strokeColor=none;verticalLabelPosition=bottom;verticalAlign=top;align=center;" vertex="1" parent="1">+ <mxGeometry x="0" y="0" width="60" height="60" as="geometry" />+</mxCell>+```++++## Shapes (19)++- `cinder_volume`+- `cinder_volumeattachment`+- `designate_recordset`+- `designate_zone`+- `heat_autoscalinggroup`+- `heat_resourcegroup`+- `heat_scalingpolicy`+- `mxgraph.openstack`+- `neutron_floatingip`+- `neutron_floatingipassociation`+- `neutron_net`+- `neutron_port`+- `neutron_router`+- `neutron_routerinterface`+- `neutron_securitygroup`+- `neutron_subnet`+- `nova_keypair`+- `nova_server`+- `swift_container`diff --git a/skill/flow-skill/references/shape-libraries/pid.md b/skill/flow-skill/references/shape-libraries/pid.mdnew file mode 100644index 0000000..58b088a--- /dev/null+++ b/skill/flow-skill/references/shape-libraries/pid.md@@ -0,0 +1,22 @@+# pid++**Type:** mxgraph shapes+**Prefix:** `mxgraph.pid2valves`, `mxgraph.pid2inst`, `mxgraph.pid2misc`++## Usage++```xml+<mxCell value="label" style="shape=mxgraph.pid2valves.valve;valveType=gate;" vertex="1" parent="1">+ <mxGeometry x="0" y="0" width="60" height="60" as="geometry" />+</mxCell>+```++## Valve Types++For `mxgraph.pid2valves.valve`, use `valveType=` with:+- `gate`, `globe`, `needle`, `ball`, `butterfly`, `diaphragm`, `plug`, `check`++## Other Prefixes++- `mxgraph.pid2inst` - Instruments (discInst, sharedCont, compFunc)+- `mxgraph.pid2misc` - Miscellaneousdiff --git a/skill/flow-skill/references/shape-libraries/rack.md b/skill/flow-skill/references/shape-libraries/rack.mdnew file mode 100644index 0000000..18ecc3f--- /dev/null+++ b/skill/flow-skill/references/shape-libraries/rack.md@@ -0,0 +1,57 @@+# rack++**Type:** mxgraph shapes+**Prefix:** `mxgraph.rack`++## Usage++```xml+<mxCell value="label" style="shape=mxgraph.rack.f5.arx_500;strokeColor=#666666;" vertex="1" parent="1">+ <mxGeometry x="0" y="0" width="200" height="30" as="geometry" />+</mxCell>+```++Shapes are organized by vendor: `mxgraph.rack.{vendor}.{model}`++## Vendors++### F5++- `arx_500`+- `big_ip_1600`+- `big_ip_2000`+- `big_ip_4000`++### Dell++- `dell_poweredge_1u`+- `poweredge_630`+- `poweredge_730`++### HPE Aruba++HPE Aruba shapes have subcategories: `mxgraph.rack.hpe_aruba.{category}.{model}`++**gateways_controllers:**+- `aruba_7010_mobility_controller_front`+- `aruba_7010_mobility_controller_rear`+- `aruba_7024_mobility_controller_front`+- `aruba_7205_mobility_controller_front`++**security:**+- `aruba_clearpass_c1000_front`+- `aruba_clearpass_c2000_front`+- `aruba_clearpass_c3000_front`++**switches:**+- `j9772a_2530_48g_poeplus_switch`+- `j9773a_2530_24g_poeplus_switch`+- `jl253a_aruba_2930f_24g_4sfpplus_switch`++### General (rackGeneral)++Use `mxgraph.rackGeneral.{shape}` for generic rack items:+- `rackCabinet3`+- `plate`++(See draw.io Rack shape library for complete list)diff --git a/skill/flow-skill/references/shape-libraries/salesforce.md b/skill/flow-skill/references/shape-libraries/salesforce.mdnew file mode 100644index 0000000..b6d20ad--- /dev/null+++ b/skill/flow-skill/references/shape-libraries/salesforce.md@@ -0,0 +1,116 @@+# salesforce++**Type:** mxgraph shapes+**Prefix:** `mxgraph.salesforce`++## Usage++```xml+<mxCell value="label" style="shape=mxgraph.salesforce.analytics;fillColor=#7f8de1;strokeColor=none;verticalLabelPosition=bottom;verticalAlign=top;align=center;" vertex="1" parent="1">+ <mxGeometry x="0" y="0" width="60" height="60" as="geometry" />+</mxCell>+```++Replace `analytics` with any shape from the list below.++++## Shapes (97)++- `analytics`+- `analytics2`+- `apps`+- `apps2`+- `automation`+- `automation2`+- `automotive`+- `automotive2`+- `bots`+- `bots2`+- `builders`+- `builders2`+- `channels`+- `channels2`+- `commerce`+- `commerce2`+- `communications`+- `communications2`+- `consumer_goods`+- `consumer_goods2`+- `customer_360`+- `customer_3602`+- `data`+- `data2`+- `education`+- `education2`+- `employees`+- `employees2`+- `energy`+- `energy2`+- `field_service`+- `field_service2`+- `financial_services`+- `financial_services2`+- `government`+- `government2`+- `health`+- `health2`+- `heroku`+- `heroku2`+- `inbox`+- `inbox2`+- `industries`+- `industries2`+- `integration`+- `integration2`+- `iot`+- `iot2`+- `learning`+- `learning2`+- `loyalty`+- `loyalty2`+- `manufacturing`+- `manufacturing2`+- `marketing`+- `marketing2`+- `media`+- `media2`+- `mxgraph.salesforce`+- `non_profit`+- `non_profit2`+- `partners`+- `partners2`+- `personalization`+- `personalization2`+- `philantrophy`+- `philantrophy2`+- `platform`+- `platform2`+- `privacy`+- `privacy2`+- `retail`+- `retail2`+- `sales`+- `sales2`+- `segments`+- `segments2`+- `service`+- `service2`+- `smb`+- `smb2`+- `social_studio`+- `social_studio2`+- `stream`+- `stream2`+- `success`+- `success2`+- `sustainability`+- `sustainability2`+- `transportation_and_technology`+- `transportation_and_technology2`+- `web`+- `web2`+- `work_com`+- `work_com2`+- `workflow`+- `workflow2`diff --git a/skill/flow-skill/references/shape-libraries/sap.md b/skill/flow-skill/references/shape-libraries/sap.mdnew file mode 100644index 0000000..69dc5ab--- /dev/null+++ b/skill/flow-skill/references/shape-libraries/sap.md@@ -0,0 +1,179 @@+# sap++**Type:** SVG images+**Path:** `img/lib/sap/`++## Usage++```xml+<mxCell value="label" style="image;aspect=fixed;image=img/lib/sap/SAP_Logo.svg;verticalLabelPosition=bottom;verticalAlign=top;align=center;" vertex="1" parent="1">+ <mxGeometry x="0" y="0" width="60" height="60" as="geometry" />+</mxCell>+```++## Shapes (164)++- `1`+- `2`+- `3`+- `4`+- `5`+- `6`+- `7`+- `8`+- `9`+- `10`+- `11`+- `12`+- `13`+- `Adapter`+- `Admin`+- `Alert`+- `API`+- `API_Business_Hub_Enterprise`+- `App`+- `Application_Autoscaler`+- `Application_Frontend_Service`+- `Application_Vulnerability_Report`+- `Building`+- `Business_Application_Studio`+- `Business_Entity_Recognition`+- `Business_Process_Model_Connector_for_SAP_Signavio_Solutions`+- `Cloud`+- `Cloud_Connector`+- `Cloud_Connector2`+- `Cloud_Integration_Automation`+- `Cloud_Integration_Automation2`+- `Cloud_Transport_Management`+- `Data_Attribute_Recommendation`+- `Deploy`+- `Desktop`+- `Devices`+- `Document`+- `Document_Information_Extraction`+- `Documents`+- `Edge_Integration_Cell`+- `Event`+- `Extensibility_Service`+- `Factory`+- `Feature`+- `HTML5_App_Repository`+- `Identity_Authentication`+- `Identity_Authentication2`+- `Identity_Directory`+- `Identity_Directory2`+- `Identity_Provisioning`+- `Identity_Provisioning2`+- `Info`+- `Intelligent_Situation_Automation`+- `Invoice_Object_Recommendation`+- `Invoice_Object_Recommendation2`+- `Key`+- `Landscape_Portal_for_SAP_S4HANA_Cloud_ABAP_Environment`+- `Link`+- `Locked`+- `Machine`+- `Message`+- `Mobile`+- `OAuth_20`+- `Object_Store_on_SAP_BTP`+- `On-Premise`+- `Personalized_Recommendation`+- `SAP_AI_Core`+- `SAP_AI_Launchpad`+- `SAP_Alert_Notification_service_for_SAP_BTP`+- `SAP_Analytics_Cloud`+- `SAP_Analytics_Cloud_Embedded_Edition`+- `SAP_Application_Logging_service_for_SAP_BTP`+- `SAP_Asset_Performance_Management`+- `SAP_Audit_Log_Service`+- `SAP_Authorization_Management_Service`+- `SAP_Authorization_and_Trust_Management_service`+- `SAP_Automation_Pilot`+- `SAP_BTP,_ABAP_environment`+- `SAP_BTP,_Cloud_Foundry_runtime`+- `SAP_BTP,_Kyma_runtime`+- `SAP_Build`+- `SAP_Build_Apps`+- `SAP_Build_Apps_-_Copy`+- `SAP_Build_Code`+- `SAP_Build_Process_Automation`+- `SAP_Build_Process_Automation_-_Copy`+- `SAP_Build_Work_Zone_-_Advanced_Edition`+- `SAP_Build_Work_Zone_-_Standard_Edition`+- `SAP_Business_Accelerator_Hub`+- `SAP_Business_Data_Cloud`+- `SAP_Cloud_ALM`+- `SAP_Cloud_Application_Programming_Model`+- `SAP_Cloud_Identity,_SAP_Malware_Scanning_Service`+- `SAP_Cloud_Identity_Service`+- `SAP_Cloud_Logging`+- `SAP_Cloud_Management_Service`+- `SAP_Cloud_Transport_Management`+- `SAP_Collaborative_Demand_and_Capacity_Management`+- `SAP_Connectivity_Service`+- `SAP_Content_Agent_Service`+- `SAP_Continuous_Integration_and_Delivery`+- `SAP_Credential_Store`+- `SAP_Custom_Domain_service`+- `SAP_Data_Privacy_Integration`+- `SAP_Data_Retention_Manager`+- `SAP_Datasphere`+- `SAP_Destination_service`+- `SAP_Digital_Assistant`+- `SAP_Digital_Assistant_Service`+- `SAP_Digital_Manufacturing`+- `SAP_Document_Grounding`+- `SAP_Document_Management_Service`+- `SAP_Event_Broker_for_SAP_Cloud_Applications`+- `SAP_Green_Token`+- `SAP_HANA_Cloud`+- `SAP_HANA_Spatial_Services`+- `SAP_Health_Data_Services_for_FHIR`+- `SAP_Integration_Suite`+- `SAP_Integration_Suite_-_API_Managment`+- `SAP_Integration_Suite_-_Advanced_Event_Mesh`+- `SAP_Integration_Suite_-_Cloud_Integration`+- `SAP_Integration_Suite_-_Data_Space_Integration`+- `SAP_Integration_Suite_-_Event_Mesh`+- `SAP_Integration_Suite_-_Integration_Advisor`+- `SAP_Integration_Suite_-_Integration_Assessment`+- `SAP_Integration_Suite_-_Migration_Assessment`+- `SAP_Integration_Suite_-_Open_Connectors`+- `SAP_Integration_Suite_-_SAP_Graph`+- `SAP_Integration_Suite_-_Trading_Partner_Management`+- `SAP_Job_Scheduling_service`+- `SAP_Keystore_Service`+- `SAP_Landscape_Management_Cloud`+- `SAP_Logo`+- `SAP_Master_Data_Governance`+- `SAP_Master_Data_Integration`+- `SAP_Mobile_Services`+- `SAP_Monitoring_service_for_SAP_BTP`+- `SAP_Omnichannel_Promotion_Pricing`+- `SAP_PKI_Certificate_Service`+- `SAP_Persistence_Service_ASE`+- `SAP_Personal_Data_Manager`+- `SAP_Private_Link_service`+- `SAP_Project_and_Resource_Management`+- `SAP_Responsibility_Management_Service`+- `SAP_S4HANA_Cloud_for_Intelligent_Intercompany_Reconciliation`+- `SAP_S4HANA_for_MS_Teams`+- `SAP_Secure_Login_Service_for_SAP_GUI`+- `SAP_Service_Manager`+- `SAP_Software_as_a_Service_Provisioning_Service`+- `SAP_Solution_Lifecycle_Management_Service`+- `SAP_Sustainability_Data_Exchange`+- `SAP_Task_Center`+- `SAP_Translation_Hub`+- `SAP_Variant_Configuration_and_Pricing`+- `SAP_Watch_List_Screening`+- `Service_Ticket_Intelligence`+- `Service_Ticket_Intelligence2`+- `Settings`+- `Success`+- `Third_Party`+- `UI5_flexibility_for_key_users`+- `UI_Theme_Designer`+- `User`+- `Web`diff --git a/skill/flow-skill/references/shape-libraries/sitemap.md b/skill/flow-skill/references/shape-libraries/sitemap.mdnew file mode 100644index 0000000..bdd3cac--- /dev/null+++ b/skill/flow-skill/references/shape-libraries/sitemap.md@@ -0,0 +1,68 @@+# sitemap++**Type:** mxgraph shapes+**Prefix:** `mxgraph.sitemap`++## Usage++```xml+<mxCell value="label" style="shape=mxgraph.sitemap.{shape};fillColor=#7ea6e0;strokeColor=#6c8ebf;" vertex="1" parent="1">+ <mxGeometry x="0" y="0" width="60" height="60" as="geometry" />+</mxCell>+```++++## Shapes (51)++- `about_us`+- `audio`+- `biography`+- `blog`+- `calendar`+- `chart`+- `chat`+- `cloud`+- `contact`+- `contact_us`+- `document`+- `download`+- `error`+- `faq`+- `form`+- `gallery`+- `game`+- `home`+- `info`+- `jobs`+- `log`+- `login`+- `mail`+- `map`+- `mxgraph.sitemap`+- `news`+- `page`+- `payment`+- `photo`+- `portfolio`+- `post`+- `pricing`+- `print`+- `products`+- `profile`+- `references`+- `script`+- `search`+- `security`+- `services`+- `settings`+- `shopping`+- `sitemap`+- `slideshow`+- `sports`+- `success`+- `text`+- `upload`+- `user`+- `video`+- `warning`diff --git a/skill/flow-skill/references/shape-libraries/vvd.md b/skill/flow-skill/references/shape-libraries/vvd.mdnew file mode 100644index 0000000..6aa1a5f--- /dev/null+++ b/skill/flow-skill/references/shape-libraries/vvd.md@@ -0,0 +1,112 @@+# vvd++**Type:** mxgraph shapes+**Prefix:** `mxgraph.vvd`++## Usage++```xml+<mxCell value="label" style="shape=mxgraph.vvd.{shape};fillColor=#00AEEF;strokeColor=none;verticalLabelPosition=bottom;verticalAlign=top;align=center;" vertex="1" parent="1">+ <mxGeometry x="0" y="0" width="60" height="60" as="geometry" />+</mxCell>+```++++## Shapes (95)++- `administrator`+- `app`+- `app_volumes_manager`+- `appstack_volume`+- `array_manager`+- `blueprint`+- `business_continuity_data_protection`+- `cd`+- `cloud_computing`+- `collective_nsx_esg`+- `consumption_plane`+- `cpu`+- `datacenter`+- `datastore`+- `disk`+- `document`+- `edge_gateway`+- `endpoint`+- `ethernet_port`+- `external_networks`+- `flash_drive`+- `folder`+- `guest_agent_customization`+- `horizon`+- `infrastructure`+- `key`+- `keyboard`+- `laptop`+- `log_files`+- `logical_distribution`+- `logical_firewall`+- `machine`+- `memory`+- `monitor`+- `mouse`+- `mxgraph.vvd`+- `networking`+- `networks`+- `nfvo`+- `nsx`+- `nsx_controller`+- `nsx_dashboard`+- `nsx_edge_and_load_balancer`+- `nsx_esg`+- `nsx_manager`+- `nsx_public_cloud_gateway`+- `on_demand_self_service`+- `ovdc_networks`+- `pair_sites`+- `phone`+- `physical_network_adapter`+- `physical_storage`+- `physical_upstream_router`+- `platform_services_controller`+- `protection_group`+- `protection_group_config`+- `recovery_plan`+- `resource_pool`+- `scsi_controller`+- `security`+- `server`+- `service_provider_cloud_environment`+- `site`+- `site_container`+- `site_recovery`+- `site_recovery_functional_icon`+- `ssd`+- `storage`+- `switch`+- `telco_network`+- `template`+- `tenant_key`+- `user_group`+- `vapp_network`+- `vcenter_server`+- `vcloud_director`+- `virtual_appliance`+- `virtual_machine`+- `virtual_switch`+- `vm_group`+- `vnf_m`+- `volumes_agent`+- `vpn`+- `vrealize_automation`+- `vrealize_log_insight`+- `vrealize_operations`+- `vrealize_orchestrator`+- `vrops`+- `vsan`+- `vshield`+- `vxlan`+- `wavefront`+- `web_browser`+- `wi_fi`+- `writable_volume`diff --git a/skill/flow-skill/references/shape-libraries/webicons.md b/skill/flow-skill/references/shape-libraries/webicons.mdnew file mode 100644index 0000000..e830438--- /dev/null+++ b/skill/flow-skill/references/shape-libraries/webicons.md@@ -0,0 +1,194 @@+# webicons++**Type:** mxgraph shapes+**Prefix:** `mxgraph.webicons`++## Usage++```xml+<mxCell value="label" style="shape=mxgraph.webicons.{shape};fillColor=#3b5998;strokeColor=none;verticalLabelPosition=bottom;verticalAlign=top;align=center;" vertex="1" parent="1">+ <mxGeometry x="0" y="0" width="60" height="60" as="geometry" />+</mxCell>+```++++## Shapes (177)++- `adfty`+- `adobe_pdf`+- `aim`+- `allvoices`+- `amazon`+- `amazon_2`+- `android`+- `apache`+- `apple`+- `apple_classic`+- `arduino`+- `ask`+- `atlassian`+- `audioboo`+- `aws`+- `aws_s3`+- `baidu`+- `bebo`+- `behance`+- `bing`+- `bitbucket`+- `blinklist`+- `blogger`+- `blogmarks`+- `bookmarks.fr`+- `box`+- `buddymarks`+- `buffer`+- `buzzfeed`+- `chrome`+- `citeulike`+- `confluence`+- `connotea`+- `dealsplus`+- `delicious`+- `designfloat`+- `deviantart`+- `digg`+- `diigo`+- `dopplr`+- `drawio1`+- `drawio2`+- `dribbble`+- `dropbox`+- `dropbox2`+- `drupal`+- `dzone`+- `ebay`+- `edmodo`+- `evernote`+- `facebook`+- `fancy`+- `fark`+- `fashiolista`+- `feed`+- `feedburner`+- `flickr`+- `folkd`+- `forrst`+- `fotolog`+- `freshbump`+- `fresqui`+- `friendfeed`+- `funp`+- `fwisp`+- `gabbr`+- `gamespot`+- `github`+- `gmail`+- `google`+- `google_drive`+- `google_hangout`+- `google_photos`+- `google_play`+- `google_play_light`+- `google_plus`+- `grooveshark`+- `hatena`+- `html5`+- `identi.ca`+- `instagram`+- `instapaper`+- `ios`+- `jamespot`+- `java`+- `joomla`+- `jquery`+- `json`+- `json_2`+- `last.fm`+- `linkagogo`+- `linkedin`+- `livejournal`+- `mail.ru`+- `meetup`+- `meneame`+- `messenger`+- `messenger_2`+- `messenger_3`+- `mind_body_green`+- `mongodb`+- `mxgraph.webicons`+- `myspace`+- `n4g`+- `netlog`+- `netvibes`+- `netvouz`+- `networkedblogs`+- `newsvine`+- `odnoklassniki`+- `oknotizie`+- `onedrive`+- `oracle`+- `paypal`+- `phone`+- `phonefavs`+- `pinterest`+- `plaxo`+- `playfire`+- `plurk`+- `pocket`+- `protopage`+- `readernaut`+- `reddit`+- `rss`+- `scoopit`+- `scribd`+- `segnalo`+- `sina`+- `sitejot`+- `skype`+- `skyrock`+- `slashdot`+- `sms`+- `socialvibe`+- `society6`+- `sonico`+- `soundcloud`+- `sourceforge`+- `sourceforge_2`+- `spring.me`+- `stackexchange`+- `stackoverflow`+- `startaid`+- `startlap`+- `steam`+- `stumbleupon`+- `stumpedia`+- `technorati`+- `translate`+- `tumblr`+- `tunein`+- `twitter`+- `two`+- `typepad`+- `viadeo`+- `viber`+- `viddler`+- `vimeo`+- `virb`+- `vkontakte`+- `wakoopa`+- `weheartit`+- `whatsapp`+- `wix`+- `wordpress`+- `wordpress_2`+- `xanga`+- `xerpi`+- `xing`+- `yahoo`+- `yahoo_2`+- `yammer`+- `yandex`+- `yelp`+- `yoolink`+- `youmob`diff --git a/skill/flow-skill/references/shape-library-index.md b/skill/flow-skill/references/shape-library-index.mdnew file mode 100644index 0000000..407a04d--- /dev/null+++ b/skill/flow-skill/references/shape-library-index.md@@ -0,0 +1,33 @@+# Shape Library Index++Use this file to select the correct shape-library reference before generating specialized diagrams.++## Common choices++- `aws4.md`: AWS cloud architecture+- `azure2.md`: Azure cloud architecture+- `gcp2.md`: Google Cloud architecture+- `kubernetes.md`: Kubernetes diagrams+- `bpmn.md`: BPMN workflows+- `network.md`: network devices and topology+- `cisco19.md`: Cisco-specific network diagrams+- `floorplan.md`: floor plans and room layouts+- `material_design.md`: Material Design UI icons+- `flowchart.md`: standard flowchart shapes+- `infographic.md`: infographic-oriented iconography++## Source of truth++The canonical library references for this skill live in:++`references/shape-libraries/`++Read the needed source file directly, for example:++- `references/shape-libraries/aws4.md`+- `references/shape-libraries/azure2.md`+- `references/shape-libraries/kubernetes.md`++## Rule++If a requested domain obviously maps to a documented library, read that file before generating XML. Do not invent library prefixes or shape names.diff --git a/skill/flow-skill/references/xml-rules.md b/skill/flow-skill/references/xml-rules.mdnew file mode 100644index 0000000..daa02a5--- /dev/null+++ b/skill/flow-skill/references/xml-rules.md@@ -0,0 +1,48 @@+# XML Rules++Use these rules whenever generating or editing draw.io XML.++## Required structure++- The canonical form is `<mxGraphModel> -> <root> -> <mxCell .../>`.+- All `mxCell` elements must be direct children of `<root>`.+- Root cells must be present exactly once:+ - `id="0"`+ - `id="1" parent="0"`++## IDs++- Every `mxCell` needs a unique, non-empty `id`.+- Preserve existing ids during local edits when possible.+- Use deterministic ids for new cells, for example `node2`, `edge2`, `group2`.++## Vertices++- Use `vertex="1"` for node shapes.+- Include `<mxGeometry ... as="geometry"/>`.+- Avoid empty labels unless intentionally unlabeled.++## Edges++- Use `edge="1"` for connectors.+- `source` and `target` must reference existing ids.+- Prefer orthogonal routing unless the diagram requires another style.++## Escaping++- Escape XML attribute values with `<`, `>`, `&`, and `"` where needed.+- Do not emit XML comments.++## Layout guidance++- Keep the default viewport readable.+- Prefer compact grouped layouts over scattered placement.+- Minimize edge crossings.++## Validation++For new diagrams or non-trivial edits, run:++```powershell+node skill/flow-skill/scripts/validate-drawio-xml.mjs --input path\to\diagram.drawio+```diff --git a/skill/flow-skill/scripts/build-flow-bundle.mjs b/skill/flow-skill/scripts/build-flow-bundle.mjsnew file mode 100644index 0000000..9d311f6--- /dev/null+++ b/skill/flow-skill/scripts/build-flow-bundle.mjs@@ -0,0 +1,115 @@+#!/usr/bin/env node++import fs from "node:fs";+import path from "node:path";+import { spawnSync } from "node:child_process";+import { fileURLToPath } from "node:url";++const scriptDir = path.dirname(fileURLToPath(import.meta.url));+const skillRoot = path.resolve(scriptDir, "..");++function parseArgs(argv) {+ const args = {+ input: "",+ outDir: "",+ name: "diagram",+ title: "Draw.io Preview",+ };+ for (let i = 0; i < argv.length; i += 1) {+ const token = argv[i];+ if (token === "--input" || token === "-i") {+ args.input = argv[i + 1] || "";+ i += 1;+ } else if (token === "--out-dir" || token === "-o") {+ args.outDir = argv[i + 1] || "";+ i += 1;+ } else if (token === "--name") {+ args.name = argv[i + 1] || args.name;+ i += 1;+ } else if (token === "--title") {+ args.title = argv[i + 1] || args.title;+ i += 1;+ }+ }+ return args;+}++function fail(message) {+ console.error(message);+ process.exit(1);+}++function timestamp() {+ return new Date().toISOString().replace(/[:.]/g, "-");+}++function resolveDefaultOutputDir() {+ const cwd = path.resolve(process.cwd());+ const baseDir = cwd.startsWith(skillRoot) ? path.resolve(skillRoot, "..") : cwd;+ const dir = path.join(baseDir, `flow-skill-bundle-${timestamp()}`);+ fs.mkdirSync(dir, { recursive: true });+ return dir;+}++function main() {+ const args = parseArgs(process.argv.slice(2));+ if (!args.input) fail("Missing --input <path-to-drawio-or-xml>.");++ const inputPath = path.resolve(process.cwd(), args.input);+ const outDir = args.outDir+ ? path.resolve(process.cwd(), args.outDir)+ : resolveDefaultOutputDir();+ const xml = fs.readFileSync(inputPath, "utf8");++ fs.mkdirSync(outDir, { recursive: true });++ const drawioPath = path.join(outDir, `${args.name}.drawio`);+ const pngPath = path.join(outDir, `${args.name}.png`);+ const metadataPath = path.join(outDir, `${args.name}.metadata.json`);++ const validateScript = path.join(scriptDir, "validate-drawio-xml.mjs");+ const validateResult = spawnSync(process.execPath, [+ validateScript,+ "--input",+ inputPath,+ "--quiet",+ ], { stdio: "inherit" });++ if (validateResult.status !== 0) {+ fail("Validation failed. Bundle was not created.");+ }++ fs.writeFileSync(drawioPath, xml, "utf8");++ const exportImageScript = path.join(scriptDir, "export-drawio-image.mjs");+ const exportResult = spawnSync(process.execPath, [+ exportImageScript,+ "--input",+ drawioPath,+ "--output",+ pngPath,+ "--format",+ "png",+ ], { stdio: "inherit" });++ if (exportResult.status !== 0) {+ fail("Failed to export PNG preview.");+ }++ const metadata = {+ name: args.name,+ sourceFile: path.basename(drawioPath),+ imageFile: path.basename(pngPath),+ generatedAt: new Date().toISOString(),+ validated: true,+ notes: [+ "PNG export is generated directly to local disk through the official embed export action.",+ "The bundle includes the source .drawio file and a PNG export for quick review.",+ ],+ };++ fs.writeFileSync(metadataPath, JSON.stringify(metadata, null, 2), "utf8");+ console.log(`Flow bundle written to ${outDir}`);+}++main();diff --git a/skill/flow-skill/scripts/build-preview-html.mjs b/skill/flow-skill/scripts/build-preview-html.mjsnew file mode 100644index 0000000..b03366e--- /dev/null+++ b/skill/flow-skill/scripts/build-preview-html.mjs@@ -0,0 +1,172 @@+#!/usr/bin/env node++import fs from "node:fs";+import path from "node:path";+import { fileURLToPath } from "node:url";++const scriptDir = path.dirname(fileURLToPath(import.meta.url));+const skillRoot = path.resolve(scriptDir, "..");++function timestamp() {+ return new Date().toISOString().replace(/[:.]/g, "-");+}++function resolveDefaultOutputDir() {+ const cwd = path.resolve(process.cwd());+ const baseDir = cwd.startsWith(skillRoot) ? path.resolve(skillRoot, "..") : cwd;+ const dir = path.join(baseDir, `flow-skill-output-${timestamp()}`);+ fs.mkdirSync(dir, { recursive: true });+ return dir;+}++function parseArgs(argv) {+ const args = {+ input: "",+ output: "",+ title: "Draw.io Preview",+ embedUrl: "https://embed.diagrams.net/?embed=1&proto=json&spin=1&ui=min",+ };+ for (let i = 0; i < argv.length; i += 1) {+ const token = argv[i];+ if (token === "--input" || token === "-i") {+ args.input = argv[i + 1] || "";+ i += 1;+ } else if (token === "--output" || token === "-o") {+ args.output = argv[i + 1] || "";+ i += 1;+ } else if (token === "--title") {+ args.title = argv[i + 1] || args.title;+ i += 1;+ } else if (token === "--embed-url") {+ args.embedUrl = argv[i + 1] || args.embedUrl;+ i += 1;+ }+ }+ return args;+}++function ensureArg(value, message) {+ if (!value) {+ console.error(message);+ process.exit(1);+ }+}++function toEscapedJsonString(value) {+ return JSON.stringify(String(value));+}++function buildHtml({ xml, title, embedUrl }) {+ return `<!doctype html>+<html lang="en">+<head>+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1" />+ <title>${title}</title>+ <style>+ html, body { margin: 0; height: 100%; font-family: system-ui, sans-serif; background: #0b1020; color: #e5e7eb; }+ .shell { display: grid; grid-template-rows: 56px 1fr; height: 100%; }+ .toolbar { display: flex; gap: 8px; align-items: center; padding: 0 16px; border-bottom: 1px solid #1f2937; background: #111827; }+ .toolbar button { border: 0; border-radius: 8px; padding: 8px 12px; background: #2563eb; color: white; cursor: pointer; }+ .toolbar button.secondary { background: #374151; }+ iframe { width: 100%; height: 100%; border: 0; background: white; }+ .status { margin-left: auto; font-size: 12px; color: #9ca3af; }+ </style>+</head>+<body>+ <div class="shell">+ <div class="toolbar">+ <button id="exportSvg">Export SVG</button>+ <button id="exportPng">Export PNG</button>+ <button id="exportXmlPng" class="secondary">Export Editable PNG</button>+ <span class="status" id="status">Loading embed editor...</span>+ </div>+ <iframe id="editor" title="drawio-preview" src="${embedUrl}"></iframe>+ </div>+ <script>+ const xml = ${toEscapedJsonString(xml)};+ const editor = document.getElementById("editor");+ const status = document.getElementById("status");+ let ready = false;++ function saveDataUrl(filename, dataUrl) {+ const link = document.createElement("a");+ link.href = dataUrl;+ link.download = filename;+ document.body.appendChild(link);+ link.click();+ link.remove();+ }++ function post(action) {+ if (!ready) return;+ editor.contentWindow.postMessage(JSON.stringify(action), "*");+ }++ window.addEventListener("message", (event) => {+ let payload = event.data;+ if (typeof payload === "string") {+ try {+ payload = JSON.parse(payload);+ } catch {+ return;+ }+ }+ if (!payload || typeof payload !== "object") return;++ if (payload.event === "ready") {+ ready = true;+ status.textContent = "Loading diagram...";+ post({ action: "load", xml });+ return;+ }++ if (payload.event === "load") {+ status.textContent = "Diagram loaded";+ return;+ }++ if (payload.event === "export" && payload.data) {+ const format = payload.format || "svg";+ const ext = format === "png" || format === "xmlpng" ? "png" : format === "html" || format === "html2" ? "html" : "svg";+ saveDataUrl(\`diagram-preview.\${ext}\`, payload.data);+ status.textContent = \`Exported \${format}\`;+ }+ });++ document.getElementById("exportSvg").addEventListener("click", () => {+ status.textContent = "Exporting SVG...";+ post({ action: "export", format: "svg", xml });+ });++ document.getElementById("exportPng").addEventListener("click", () => {+ status.textContent = "Exporting PNG...";+ post({ action: "export", format: "png", xml, transparent: true, scale: 1 });+ });++ document.getElementById("exportXmlPng").addEventListener("click", () => {+ status.textContent = "Exporting editable PNG...";+ post({ action: "export", format: "xmlpng", xml, transparent: true, scale: 1 });+ });+ </script>+</body>+</html>`;+}++function main() {+ const args = parseArgs(process.argv.slice(2));+ ensureArg(args.input, "Missing --input <path-to-drawio-or-xml>.");++ const inputPath = path.resolve(process.cwd(), args.input);+ const outputPath = args.output+ ? path.resolve(process.cwd(), args.output)+ : path.join(resolveDefaultOutputDir(), "diagram.preview.html");+ const xml = fs.readFileSync(inputPath, "utf8");+ const html = buildHtml({ xml, title: args.title, embedUrl: args.embedUrl });++ fs.mkdirSync(path.dirname(outputPath), { recursive: true });+ fs.writeFileSync(outputPath, html, "utf8");+ console.log(`Preview HTML written to ${outputPath}`);+}++main();diff --git a/skill/flow-skill/scripts/export-drawio-image.mjs b/skill/flow-skill/scripts/export-drawio-image.mjsnew file mode 100644index 0000000..4fb32ea--- /dev/null+++ b/skill/flow-skill/scripts/export-drawio-image.mjs@@ -0,0 +1,199 @@+#!/usr/bin/env node++import fs from "node:fs";+import path from "node:path";+import { fileURLToPath } from "node:url";++const DEFAULT_EMBED_URL = "https://embed.diagrams.net/?embed=1&proto=json&spin=1&ui=min";+const scriptDir = path.dirname(fileURLToPath(import.meta.url));+const skillRoot = path.resolve(scriptDir, "..");++function parseArgs(argv) {+ const args = {+ input: "",+ output: "",+ format: "png",+ embedUrl: DEFAULT_EMBED_URL,+ timeout: 60000,+ transparent: true,+ };++ for (let i = 0; i < argv.length; i += 1) {+ const token = argv[i];+ if (token === "--input" || token === "-i") {+ args.input = argv[i + 1] || "";+ i += 1;+ } else if (token === "--output" || token === "-o") {+ args.output = argv[i + 1] || "";+ i += 1;+ } else if (token === "--format" || token === "-f") {+ args.format = argv[i + 1] || args.format;+ i += 1;+ } else if (token === "--embed-url") {+ args.embedUrl = argv[i + 1] || args.embedUrl;+ i += 1;+ } else if (token === "--timeout") {+ args.timeout = Number(argv[i + 1] || args.timeout);+ i += 1;+ } else if (token === "--opaque") {+ args.transparent = false;+ }+ }++ return args;+}++function fail(message) {+ console.error(message);+ process.exit(1);+}++function timestamp() {+ return new Date().toISOString().replace(/[:.]/g, "-");+}++function resolveDefaultOutputDir() {+ const cwd = path.resolve(process.cwd());+ const baseDir = cwd.startsWith(skillRoot) ? path.resolve(skillRoot, "..") : cwd;+ const dir = path.join(baseDir, `flow-skill-output-${timestamp()}`);+ fs.mkdirSync(dir, { recursive: true });+ return dir;+}++function defaultExtension(format) {+ if (format === "svg") return "svg";+ if (format === "xmlpng") return "png";+ return "png";+}++async function loadPlaywright() {+ try {+ return await import("playwright");+ } catch (error) {+ fail(+ "Missing dependency 'playwright'. Run 'npm install' inside skill/flow-skill, then 'npx playwright install chromium'.",+ );+ }+}++function decodeDataUri(uri) {+ const match = String(uri || "").match(/^data:([^;]+);base64,(.*)$/);+ if (!match) {+ fail("Export did not return a base64 data URI.");+ }+ return {+ mediaType: match[1],+ buffer: Buffer.from(match[2], "base64"),+ };+}++function buildHarnessHtml({ xml, embedUrl, format, transparent }) {+ return `<!doctype html>+<html lang="en">+<head>+ <meta charset="utf-8" />+ <title>flow-skill-export</title>+ <style>html,body,iframe{margin:0;width:100%;height:100%;border:0;background:white}</style>+</head>+<body>+ <iframe id="editor" src="${embedUrl}"></iframe>+ <script>+ const xml = ${JSON.stringify(xml)};+ const format = ${JSON.stringify(format)};+ const transparent = ${transparent ? "true" : "false"};+ const iframe = document.getElementById("editor");++ function post(message) {+ iframe.contentWindow.postMessage(JSON.stringify(message), "*");+ }++ window.addEventListener("message", (event) => {+ let payload = event.data;+ if (typeof payload === "string") {+ try {+ payload = JSON.parse(payload);+ } catch {+ return;+ }+ }+ if (!payload || typeof payload !== "object") return;++ if (payload.event === "init" || payload.event === "ready") {+ post({ action: "load", xml });+ return;+ }++ if (payload.event === "load") {+ post({+ action: "export",+ format,+ xml,+ transparent,+ scale: 1,+ keepTheme: true+ });+ return;+ }++ if (payload.event === "export") {+ window.__FLOW_EXPORT_RESULT__ = payload;+ }++ if (payload.error) {+ window.__FLOW_EXPORT_ERROR__ = payload;+ }+ });+ </script>+</body>+</html>`;+}++async function main() {+ const args = parseArgs(process.argv.slice(2));+ if (!args.input) fail("Missing --input <path-to-drawio-or-xml>.");++ const inputPath = path.resolve(process.cwd(), args.input);+ const outputPath = args.output+ ? path.resolve(process.cwd(), args.output)+ : path.join(resolveDefaultOutputDir(), `diagram.${defaultExtension(args.format)}`);+ const xml = fs.readFileSync(inputPath, "utf8");++ const { chromium } = await loadPlaywright();+ const browser = await chromium.launch({ headless: true });+ const page = await browser.newPage();++ try {+ const html = buildHarnessHtml({+ xml,+ embedUrl: args.embedUrl,+ format: args.format,+ transparent: args.transparent,+ });++ await page.setContent(html, { waitUntil: "load", timeout: args.timeout });++ const result = await page.waitForFunction(+ () => window.__FLOW_EXPORT_RESULT__ || window.__FLOW_EXPORT_ERROR__,+ { timeout: args.timeout },+ );++ const payload = await result.jsonValue();+ if (payload?.error) {+ fail(`Remote export failed: ${payload.error}`);+ }++ if (!payload?.data) {+ fail("Remote export did not return export data.");+ }++ const { buffer } = decodeDataUri(payload.data);+ fs.mkdirSync(path.dirname(outputPath), { recursive: true });+ fs.writeFileSync(outputPath, buffer);+ console.log(`Exported ${args.format} to ${outputPath}`);+ } finally {+ await page.close();+ await browser.close();+ }+}++main();diff --git a/skill/flow-skill/scripts/validate-drawio-xml.mjs b/skill/flow-skill/scripts/validate-drawio-xml.mjsnew file mode 100644index 0000000..565812f--- /dev/null+++ b/skill/flow-skill/scripts/validate-drawio-xml.mjs@@ -0,0 +1,101 @@+#!/usr/bin/env node++import fs from "node:fs";+import path from "node:path";++function parseArgs(argv) {+ const args = { input: "", quiet: false };+ for (let i = 0; i < argv.length; i += 1) {+ const token = argv[i];+ if (token === "--input" || token === "-i") {+ args.input = argv[i + 1] || "";+ i += 1;+ } else if (token === "--quiet") {+ args.quiet = true;+ }+ }+ return args;+}++function fail(message) {+ console.error(message);+ process.exit(1);+}++function extractValue(source, pattern, fallback = "") {+ const match = source.match(pattern);+ return match ? match[1] : fallback;+}++function collectCells(xml) {+ const cells = [];+ const cellPattern = /<mxCell\b([^>]*?)(?:\/>|>[\s\S]*?<\/mxCell>)/g;+ let match = cellPattern.exec(xml);+ while (match) {+ const attrs = match[1] || "";+ cells.push({+ raw: match[0],+ id: extractValue(attrs, /\bid="([^"]+)"/, ""),+ parent: extractValue(attrs, /\bparent="([^"]+)"/, ""),+ source: extractValue(attrs, /\bsource="([^"]+)"/, ""),+ target: extractValue(attrs, /\btarget="([^"]+)"/, ""),+ edge: /\bedge="1"/.test(attrs),+ });+ match = cellPattern.exec(xml);+ }+ return cells;+}++function main() {+ const args = parseArgs(process.argv.slice(2));+ if (!args.input) {+ fail("Usage: node validate-drawio-xml.mjs --input <path-to-xml-or-drawio>");+ }++ const inputPath = path.resolve(process.cwd(), args.input);+ const xml = fs.readFileSync(inputPath, "utf8");++ if (!xml.includes("<mxGraphModel") || !xml.includes("<root")) {+ fail("Invalid draw.io XML: missing <mxGraphModel> or <root>.");+ }++ const cells = collectCells(xml);+ if (cells.length === 0) {+ fail("Invalid draw.io XML: no mxCell elements found.");+ }++ const ids = new Set();+ for (const cell of cells) {+ if (!cell.id) fail("Invalid draw.io XML: found mxCell without id.");+ if (ids.has(cell.id)) fail(`Invalid draw.io XML: duplicate id "${cell.id}".`);+ ids.add(cell.id);+ }++ if (!ids.has("0")) fail('Invalid draw.io XML: missing root cell id="0".');+ if (!ids.has("1")) fail('Invalid draw.io XML: missing root cell id="1".');++ const cell1 = cells.find((cell) => cell.id === "1");+ if (!cell1 || cell1.parent !== "0") {+ fail('Invalid draw.io XML: root cell id="1" must have parent="0".');+ }++ for (const cell of cells) {+ if (cell.id !== "0" && !cell.parent) {+ fail(`Invalid draw.io XML: cell "${cell.id}" is missing parent.`);+ }+ if (cell.edge) {+ if (cell.source && !ids.has(cell.source)) {+ fail(`Invalid draw.io XML: edge "${cell.id}" source "${cell.source}" not found.`);+ }+ if (cell.target && !ids.has(cell.target)) {+ fail(`Invalid draw.io XML: edge "${cell.id}" target "${cell.target}" not found.`);+ }+ }+ }++ if (!args.quiet) {+ console.log(`Valid draw.io XML: ${cells.length} cells checked in ${inputPath}`);+ }+}++main();diff --git a/skill/infographic-skill/SKILL.md b/skill/infographic-skill/SKILL.mdnew file mode 100644index 0000000..7d44ecd--- /dev/null+++ b/skill/infographic-skill/SKILL.md@@ -0,0 +1,90 @@+---+name: infographic-skill+description: Generate final infographic images from structured content requirements. Use for single infographic tasks, data summaries, process explainers, comparison boards, timelines, and other single-frame information graphics that should export directly to local image files.+---++# Infographic Skill++## Trigger++Use when the task requires one final infographic image.++## First-Use Reminder++On the first use of this skill in a conversation, remind the user that image generation is configurable and tell them which model vendors are supported in `config/image-provider.json`.++Supported vendors:++- `openai`+- `aliyun`+- `tencent`+- `bytedance`+- `zhipu`+- `google`+- `xai`+- `bfl`+- `adobe`++## Order++1. Confirm the task is an infographic task.+2. Collect required fields.+3. Ask follow-up questions for missing required fields.+4. Read the required references.+5. Produce the final infographic prompt.+6. Generate the image through the configured provider.+7. Export or bundle artifacts when requested.++## Required Fields++- `theme`+- `size` or `aspect_ratio`+- `style_direction`+- `color_direction`+- `information_points`+- `data_status`++Do not guess missing required fields.++## Required References++- `references/infographic-fields.md`+- `references/prompt-rules.md`+- `references/image-provider-config.md`+- `references/output-contract.md`++## Prompt Contract++- Produce one final infographic prompt.+- Keep the output specific to one frame.+- Emphasize structure, hierarchy, and readability.+- Include information sections, chart intent, and visual grouping when provided.+- Keep provided copy and data explicit.+- Do not invent unsupported metrics, rankings, dates, or claims.+- Treat reference images as visual guidance only.+- Do not treat reference images as factual sources for data, copy, dates, or claims.++## Provider Contract++- Use the configured image provider for image generation.+- Require `config/image-provider.json` before image generation.+- Do not ask the user to paste API keys into chat.+- Stop and tell the user to fill `config/image-provider.json` when provider, apiKey, or model is missing.+- Pass a reference image only when `reference_image_status` is positive and a usable reference image URL is available.++## Scripts++- `scripts/generate-infographic-image.mjs`+- `scripts/build-infographic-bundle.mjs`++## Deliverables++Preferred:++- `png`+- metadata JSON++Optional on request:++- `jpg`+- prompt textdiff --git a/skill/infographic-skill/agents/openai.yaml b/skill/infographic-skill/agents/openai.yamlnew file mode 100644index 0000000..3278bbc--- /dev/null+++ b/skill/infographic-skill/agents/openai.yaml@@ -0,0 +1,7 @@+interface:+ display_name: "Infographic Skill"+ short_description: "Generate single-frame infographic images with structured information and local export."+ default_prompt: "Use $infographic-skill to generate a final infographic image and save it locally."++policy:+ allow_implicit_invocation: truediff --git a/skill/infographic-skill/config/image-provider.json b/skill/infographic-skill/config/image-provider.jsonnew file mode 100644index 0000000..ffb9855--- /dev/null+++ b/skill/infographic-skill/config/image-provider.json@@ -0,0 +1,6 @@+{+ "provider": "",+ "apiKey": "",+ "baseUrl": "",+ "model": ""+}diff --git a/skill/infographic-skill/package.json b/skill/infographic-skill/package.jsonnew file mode 100644index 0000000..4138748--- /dev/null+++ b/skill/infographic-skill/package.json@@ -0,0 +1,10 @@+{+ "name": "infographic-skill",+ "private": true,+ "version": "1.0.0",+ "type": "module",+ "scripts": {+ "generate:image": "node scripts/generate-infographic-image.mjs",+ "build:bundle": "node scripts/build-infographic-bundle.mjs"+ }+}diff --git a/skill/infographic-skill/prompts/generate.md b/skill/infographic-skill/prompts/generate.mdnew file mode 100644index 0000000..13eea0b--- /dev/null+++ b/skill/infographic-skill/prompts/generate.md@@ -0,0 +1,17 @@+# Infographic Generation Prompt++Build one final image-generation prompt for a single infographic.++## Requirements++- use the collected infographic fields+- keep the image single-frame+- keep the information hierarchy explicit+- keep the section grouping explicit+- keep the chart intent explicit when charting is requested+- keep the text content and data points explicit+- avoid adding unsupported facts or metrics++## Missing Data Rule++If any required field is missing, ask follow-up questions before producing the final prompt.diff --git a/skill/infographic-skill/references/image-provider-config.md b/skill/infographic-skill/references/image-provider-config.mdnew file mode 100644index 0000000..b632cb5--- /dev/null+++ b/skill/infographic-skill/references/image-provider-config.md@@ -0,0 +1,48 @@+# Image Provider Config++Image generation uses `config/image-provider.json`.++## Required keys++- `provider`+- `apiKey`+- `model`++## Optional keys++- `baseUrl`++## File Path++- `config/image-provider.json`++## Example++```json+{+ "provider": "openai",+ "apiKey": "YOUR_KEY",+ "baseUrl": "https://api.openai.com/v1",+ "model": "gpt-image-1"+}+```++## Supported providers++- `openai`+- `aliyun`+- `tencent`+- `bytedance`+- `zhipu`+- `google`+- `xai`+- `bfl`+- `adobe`++## Rule++Do not ask the user to paste API keys into chat.++If image generation is requested and `config/image-provider.json` is missing or incomplete, stop and tell the user to fill that file.++If a reference image is provided but the selected provider or model does not support reference images, ignore the reference image and continue only if the task still makes sense without it. Do not claim that the model used the reference image when it did not.diff --git a/skill/infographic-skill/references/infographic-fields.md b/skill/infographic-skill/references/infographic-fields.mdnew file mode 100644index 0000000..5328902--- /dev/null+++ b/skill/infographic-skill/references/infographic-fields.md@@ -0,0 +1,30 @@+# Infographic Fields++Collect these fields before generation.++## Required++- `theme`+- `size` or `aspect_ratio`+- `style_direction`+- `color_direction`+- `information_points`+- `data_status`++## Optional++- `chart_type`+- `orientation`+- `section_titles`+- `supporting_copy`+- `summary_copy`+- `cta`+- `reference_image_status`+- `reference_image_url`+- `export_format`++## Rule++If any required field is missing, ask follow-up questions before generation.++If `reference_image_status` is positive, request `reference_image_url` before generation.diff --git a/skill/infographic-skill/references/output-contract.md b/skill/infographic-skill/references/output-contract.mdnew file mode 100644index 0000000..cb33dca--- /dev/null+++ b/skill/infographic-skill/references/output-contract.md@@ -0,0 +1,24 @@+# Output Contract++Default output:++- `png`+- `metadata.json`++Optional outputs:++- `jpg`+- `prompt.txt`++## Metadata++Metadata should include:++- theme+- size or aspect ratio+- style+- color direction+- provider+- model+- output file name+- generation timestampdiff --git a/skill/infographic-skill/references/prompt-rules.md b/skill/infographic-skill/references/prompt-rules.mdnew file mode 100644index 0000000..99f79fe--- /dev/null+++ b/skill/infographic-skill/references/prompt-rules.md@@ -0,0 +1,17 @@+# Prompt Rules++Use these rules when building the final infographic generation prompt.++- Keep the output focused on one infographic image.+- State the intended size or aspect ratio.+- State the visual style clearly.+- State the color direction clearly.+- State the information hierarchy clearly.+- State chart intent when charting is requested.+- Include the required textual content and data points explicitly.+- Use concise, concrete visual language.+- Prioritize readability, grouping, and section clarity over decorative effects.+- Do not invent extra metrics, claims, rankings, dates, or brand facts.+- If the user provides a reference image, treat it as style, composition, spacing, or mood guidance.+- Do not treat a reference image as a source of facts or data.+- If the reference image conflicts with explicit user instructions, follow the explicit user instructions.diff --git a/skill/infographic-skill/scripts/build-infographic-bundle.mjs b/skill/infographic-skill/scripts/build-infographic-bundle.mjsnew file mode 100644index 0000000..fd723e8--- /dev/null+++ b/skill/infographic-skill/scripts/build-infographic-bundle.mjs@@ -0,0 +1,93 @@+#!/usr/bin/env node++import fs from "node:fs";+import path from "node:path";+import { spawnSync } from "node:child_process";+import { fileURLToPath } from "node:url";++function parseArgs(argv) {+ const args = {+ promptFile: "",+ outDir: "",+ name: "infographic",+ configFile: "",+ format: "png",+ referenceImageUrl: "",+ };+ for (let i = 0; i < argv.length; i += 1) {+ const token = argv[i];+ if (token === "--prompt-file") {+ args.promptFile = argv[i + 1] || "";+ i += 1;+ } else if (token === "--out-dir" || token === "-o") {+ args.outDir = argv[i + 1] || "";+ i += 1;+ } else if (token === "--name") {+ args.name = argv[i + 1] || args.name;+ i += 1;+ } else if (token === "--config-file") {+ args.configFile = argv[i + 1] || "";+ i += 1;+ } else if (token === "--format") {+ args.format = argv[i + 1] || args.format;+ i += 1;+ } else if (token === "--reference-image-url") {+ args.referenceImageUrl = argv[i + 1] || "";+ i += 1;+ }+ }+ return args;+}++function fail(message) {+ console.error(message);+ process.exit(1);+}++function main() {+ const args = parseArgs(process.argv.slice(2));+ if (!args.promptFile) fail("Missing --prompt-file <path-to-prompt>.");+ if (!args.outDir) fail("Missing --out-dir <bundle-directory>.");++ const promptFile = path.resolve(process.cwd(), args.promptFile);+ const outDir = path.resolve(process.cwd(), args.outDir);+ const scriptDir = path.dirname(fileURLToPath(import.meta.url));+ const generateScript = path.join(scriptDir, "generate-infographic-image.mjs");+ const imagePath = path.join(outDir, `${args.name}.${args.format}`);+ const metadataPath = path.join(outDir, `${args.name}.metadata.json`);+ const promptCopyPath = path.join(outDir, `${args.name}.prompt.txt`);++ fs.mkdirSync(outDir, { recursive: true });+ fs.copyFileSync(promptFile, promptCopyPath);++ const command = [+ generateScript,+ "--prompt-file",+ promptFile,+ "--output",+ imagePath,+ "--format",+ args.format,+ ];+ if (args.configFile) {+ command.push("--config-file", path.resolve(process.cwd(), args.configFile));+ }+ if (args.referenceImageUrl) {+ command.push("--reference-image-url", args.referenceImageUrl);+ }++ const result = spawnSync(process.execPath, command, { stdio: "inherit" });+ if (result.status !== 0) fail("Infographic image generation failed.");++ const metadata = {+ name: args.name,+ imageFile: path.basename(imagePath),+ promptFile: path.basename(promptCopyPath),+ generatedAt: new Date().toISOString(),+ format: args.format,+ };+ fs.writeFileSync(metadataPath, JSON.stringify(metadata, null, 2), "utf8");+ console.log(`Infographic bundle written to ${outDir}`);+}++main();diff --git a/skill/infographic-skill/scripts/generate-infographic-image.mjs b/skill/infographic-skill/scripts/generate-infographic-image.mjsnew file mode 100644index 0000000..bdeb1f9--- /dev/null+++ b/skill/infographic-skill/scripts/generate-infographic-image.mjs@@ -0,0 +1,106 @@+#!/usr/bin/env node++import fs from "node:fs";+import path from "node:path";+import { generateImageThroughGateway } from "./lib/gateway.mjs";+import { getDefaultBaseUrl } from "./lib/provider-registry.mjs";++function parseArgs(argv) {+ const args = {+ prompt: "",+ promptFile: "",+ output: "",+ format: "png",+ configFile: "",+ referenceImageUrl: "",+ };+ for (let i = 0; i < argv.length; i += 1) {+ const token = argv[i];+ if (token === "--prompt") {+ args.prompt = argv[i + 1] || "";+ i += 1;+ } else if (token === "--prompt-file") {+ args.promptFile = argv[i + 1] || "";+ i += 1;+ } else if (token === "--output" || token === "-o") {+ args.output = argv[i + 1] || "";+ i += 1;+ } else if (token === "--format" || token === "-f") {+ args.format = argv[i + 1] || args.format;+ i += 1;+ } else if (token === "--config-file") {+ args.configFile = argv[i + 1] || "";+ i += 1;+ } else if (token === "--reference-image-url") {+ args.referenceImageUrl = argv[i + 1] || "";+ i += 1;+ }+ }+ return args;+}++function fail(message) {+ console.error(message);+ process.exit(1);+}++function loadConfig(configFile) {+ const target = configFile+ ? path.resolve(process.cwd(), configFile)+ : path.resolve(process.cwd(), "config", "image-provider.json");+ if (!fs.existsSync(target)) {+ fail(`Missing provider config file: ${target}`);+ }+ return JSON.parse(fs.readFileSync(target, "utf8"));+}++function decodeDataUrl(dataUrl) {+ const match = String(dataUrl || "").match(/^data:([^;]+);base64,(.*)$/);+ if (!match) fail("Image generation did not return a base64 data URL.");+ return {+ buffer: Buffer.from(match[2], "base64"),+ };+}++async function main() {+ const args = parseArgs(process.argv.slice(2));+ if (!args.output) fail("Missing --output <path-to-image>.");++ const prompt = args.promptFile+ ? fs.readFileSync(path.resolve(process.cwd(), args.promptFile), "utf8")+ : args.prompt;++ if (!String(prompt || "").trim()) fail("Missing prompt. Use --prompt or --prompt-file.");++ const rawConfig = loadConfig(args.configFile);+ const provider = String(rawConfig.provider || "").trim().toLowerCase();+ const apiKey = String(rawConfig.apiKey || "").trim();+ const model = String(rawConfig.model || "").trim();+ const baseUrl = String(rawConfig.baseUrl || getDefaultBaseUrl(provider) || "").trim();++ if (!provider || !apiKey || !model) {+ fail("Missing image provider configuration. Required: provider, apiKey, model.");+ }++ const dataUrl = await generateImageThroughGateway({+ channel: {+ provider,+ apiKey,+ baseUrl,+ model,+ },+ prompt,+ referenceImageUrl: args.referenceImageUrl || undefined,+ });++ const { buffer } = decodeDataUrl(dataUrl);+ const outputPath = path.resolve(process.cwd(), args.output);+ fs.mkdirSync(path.dirname(outputPath), { recursive: true });+ fs.writeFileSync(outputPath, buffer);+ console.log(`Infographic image written to ${outputPath}`);+}++main().catch((error) => {+ console.error(error instanceof Error ? error.message : String(error));+ process.exit(1);+});diff --git a/skill/infographic-skill/scripts/lib/gateway.mjs b/skill/infographic-skill/scripts/lib/gateway.mjsnew file mode 100644index 0000000..ae80df7--- /dev/null+++ b/skill/infographic-skill/scripts/lib/gateway.mjs@@ -0,0 +1,115 @@+import { resolveImageRoute } from "./provider-registry.mjs";++function joinUrl(baseUrl, endpoint) {+ const base = String(baseUrl || "").trim().replace(/\/+$/, "");+ const path = String(endpoint || "").trim();+ if (!path) return base;+ if (/^https?:\/\//i.test(path)) return path;+ if (!base) return path;+ return `${base}/${path.replace(/^\/+/, "")}`;+}++async function convertRemoteImageToDataUrl(url) {+ if (url.startsWith("data:image")) return url;+ const response = await fetch(url);+ if (!response.ok) throw new Error(`Failed to fetch remote image with status ${response.status}`);+ const contentType = response.headers.get("content-type") || "image/png";+ const buffer = Buffer.from(await response.arrayBuffer());+ return `data:${contentType};base64,${buffer.toString("base64")}`;+}++function extractImageUrlFromOpenAIContent(content) {+ if (Array.isArray(content)) {+ const imagePart = content.find((part) => part?.type === "image_url" && part?.image_url?.url);+ if (imagePart?.image_url?.url) return String(imagePart.image_url.url);+ const textPart = content.find((part) => part?.type === "text" && typeof part?.text === "string");+ if (textPart?.text) {+ const markdownMatch = textPart.text.match(/!\[.*?\]\((.*?)\)/);+ if (markdownMatch?.[1]) return markdownMatch[1];+ if (/^https?:\/\//i.test(textPart.text.trim()) || textPart.text.trim().startsWith("data:image")) {+ return textPart.text.trim();+ }+ }+ return null;+ }++ if (typeof content === "string") {+ const markdownMatch = content.match(/!\[.*?\]\((.*?)\)/);+ if (markdownMatch?.[1]) return markdownMatch[1];+ if (/^https?:\/\//i.test(content.trim()) || content.trim().startsWith("data:image")) return content.trim();+ }++ return null;+}++async function requestOpenAIImages(req) {+ const response = await fetch(joinUrl(req.channel.baseUrl, "/images/generations"), {+ method: "POST",+ headers: {+ Authorization: `Bearer ${req.channel.apiKey}`,+ "Content-Type": "application/json",+ },+ body: JSON.stringify({+ model: req.channel.model,+ prompt: req.prompt,+ }),+ });++ const text = await response.text();+ let parsed = null;+ try {+ parsed = text ? JSON.parse(text) : null;+ } catch {+ parsed = null;+ }+ if (!response.ok) {+ throw new Error(parsed?.error?.message || parsed?.error || text || `Request failed with status ${response.status}`);+ }++ const first = parsed?.data?.[0];+ if (first?.b64_json) return `data:image/png;base64,${first.b64_json}`;+ if (first?.url) return await convertRemoteImageToDataUrl(String(first.url));+ throw new Error("Image request succeeded but returned no image data.");+}++async function requestOpenAIChatImage(req) {+ const content = [{ type: "text", text: req.prompt }];+ if (req.referenceImageUrl) {+ content.push({ type: "image_url", image_url: { url: req.referenceImageUrl } });+ }++ const response = await fetch(joinUrl(req.channel.baseUrl, "/chat/completions"), {+ method: "POST",+ headers: {+ Authorization: `Bearer ${req.channel.apiKey}`,+ "Content-Type": "application/json",+ },+ body: JSON.stringify({+ model: req.channel.model,+ messages: [{ role: "user", content: content.length > 1 ? content : req.prompt }],+ stream: false,+ }),+ });++ const text = await response.text();+ let parsed = null;+ try {+ parsed = text ? JSON.parse(text) : null;+ } catch {+ parsed = null;+ }+ if (!response.ok) {+ throw new Error(parsed?.error?.message || parsed?.error || text || `Request failed with status ${response.status}`);+ }++ const url = extractImageUrlFromOpenAIContent(parsed?.choices?.[0]?.message?.content);+ if (!url) throw new Error("Image request succeeded but returned no image URL.");+ return await convertRemoteImageToDataUrl(url);+}++export async function generateImageThroughGateway(req) {+ const route = resolveImageRoute(req.channel);++ if (route.protocol === "openai-images") return await requestOpenAIImages(req);+ return await requestOpenAIChatImage(req);+}diff --git a/skill/infographic-skill/scripts/lib/provider-registry.mjs b/skill/infographic-skill/scripts/lib/provider-registry.mjsnew file mode 100644index 0000000..d15cd5b--- /dev/null+++ b/skill/infographic-skill/scripts/lib/provider-registry.mjs@@ -0,0 +1,51 @@+function matchesRule(provider, model, rules) {+ const normalizedProvider = String(provider || "").toLowerCase();+ const normalizedModel = String(model || "");+ return rules.some(+ (rule) =>+ rule.provider === normalizedProvider &&+ rule.patterns.some((pattern) => pattern.test(normalizedModel)),+ );+}++const IMAGE_OPENAI_IMAGES_RULES = [+ { provider: "openai", patterns: [/gpt-image/i, /dall-e/i] },+];++const IMAGE_REFERENCE_RULES = [+ { provider: "openai", patterns: [/gpt-image/i] },+ { provider: "aliyun", patterns: [/wan/i, /qwen-image/i] },+ { provider: "bytedance", patterns: [/seedream/i] },+ { provider: "zhipu", patterns: [/glm-image/i, /cogview/i] },+ { provider: "tencent", patterns: [/hunyuan/i] },+];++const IMAGE_PROVIDER_OPTIONS = [+ { id: "openai", defaultBaseUrl: "https://api.openai.com/v1" },+ { id: "aliyun", defaultBaseUrl: "" },+ { id: "tencent", defaultBaseUrl: "" },+ { id: "bytedance", defaultBaseUrl: "" },+ { id: "zhipu", defaultBaseUrl: "" },+ { id: "google", defaultBaseUrl: "" },+ { id: "xai", defaultBaseUrl: "" },+ { id: "bfl", defaultBaseUrl: "" },+ { id: "adobe", defaultBaseUrl: "" },+];++export function getDefaultBaseUrl(provider) {+ return IMAGE_PROVIDER_OPTIONS.find((item) => item.id === provider)?.defaultBaseUrl || "";+}++export function resolveImageRoute(channel) {+ const provider = String(channel.provider || "").toLowerCase();+ if (!IMAGE_PROVIDER_OPTIONS.some((item) => item.id === provider)) {+ throw new Error(`Unsupported image provider: ${provider}`);+ }++ return {+ protocol: matchesRule(provider, channel.model, IMAGE_OPENAI_IMAGES_RULES)+ ? "openai-images"+ : "openai-chat-image",+ supportsReferenceImages: matchesRule(provider, channel.model, IMAGE_REFERENCE_RULES),+ };+}diff --git a/skill/poster-skill/SKILL.md b/skill/poster-skill/SKILL.mdnew file mode 100644index 0000000..5bc805f--- /dev/null+++ b/skill/poster-skill/SKILL.md@@ -0,0 +1,89 @@+---+name: poster-skill+description: Generate final poster images from structured requirements. Use for single-poster tasks, campaign posters, event posters, launch visuals, and other single-frame promotional graphics that should export directly to local image files.+---++# Poster Skill++## Trigger++Use when the task requires one final poster image.++## First-Use Reminder++On the first use of this skill in a conversation, remind the user that image generation is configurable and tell them which model vendors are supported in `config/image-provider.json`.++Supported vendors:++- `openai`+- `aliyun`+- `tencent`+- `bytedance`+- `zhipu`+- `google`+- `xai`+- `bfl`+- `adobe`++## Order++1. Confirm the task is a poster task.+2. Collect required fields.+3. Ask follow-up questions for missing required fields.+4. Read the required references.+5. Produce the final poster prompt.+6. Generate the image through the configured provider.+7. Export or bundle artifacts when requested.++## Required Fields++- `theme`+- `size` or `aspect_ratio`+- `style_direction`+- `color_direction`+- `primary_copy`+- `reference_image_status`++Do not guess missing required fields.++## Required References++- `references/poster-fields.md`+- `references/prompt-rules.md`+- `references/image-provider-config.md`+- `references/output-contract.md`++## Prompt Contract++- Produce one final poster prompt.+- Keep the output specific to one frame.+- Include composition, focal area, typography intent, and color direction.+- Keep provided copy explicit.+- Do not invent unsupported claims, pricing, or brand facts.+- Treat reference images as visual guidance only.+- Do not treat reference images as factual sources for copy, branding, pricing, dates, or claims.++## Provider Contract++- Use the configured image provider for image generation.+- Require `config/image-provider.json` before image generation.+- Do not ask the user to paste API keys into chat.+- Stop and tell the user to fill `config/image-provider.json` when provider, apiKey, or model is missing.+- Pass a reference image only when `reference_image_status` is positive and a usable reference image URL is available.++## Scripts++- `scripts/generate-poster-image.mjs`+- `scripts/build-poster-bundle.mjs`++## Deliverables++Preferred:++- `png`+- metadata JSON++Optional on request:++- `jpg`+- prompt textdiff --git a/skill/poster-skill/agents/openai.yaml b/skill/poster-skill/agents/openai.yamlnew file mode 100644index 0000000..72fd3c1--- /dev/null+++ b/skill/poster-skill/agents/openai.yaml@@ -0,0 +1,7 @@+interface:+ display_name: "Poster Skill"+ short_description: "Generate single-poster images with provider-based image routing and local file export."+ default_prompt: "Use $poster-skill to generate a final poster image and save it locally."++policy:+ allow_implicit_invocation: truediff --git a/skill/poster-skill/config/image-provider.json b/skill/poster-skill/config/image-provider.jsonnew file mode 100644index 0000000..ffb9855--- /dev/null+++ b/skill/poster-skill/config/image-provider.json@@ -0,0 +1,6 @@+{+ "provider": "",+ "apiKey": "",+ "baseUrl": "",+ "model": ""+}diff --git a/skill/poster-skill/package.json b/skill/poster-skill/package.jsonnew file mode 100644index 0000000..61009c3--- /dev/null+++ b/skill/poster-skill/package.json@@ -0,0 +1,10 @@+{+ "name": "poster-skill",+ "private": true,+ "version": "1.0.0",+ "type": "module",+ "scripts": {+ "generate:image": "node scripts/generate-poster-image.mjs",+ "build:bundle": "node scripts/build-poster-bundle.mjs"+ }+}diff --git a/skill/poster-skill/prompts/generate.md b/skill/poster-skill/prompts/generate.mdnew file mode 100644index 0000000..b6d4941--- /dev/null+++ b/skill/poster-skill/prompts/generate.md@@ -0,0 +1,16 @@+# Poster Generation Prompt++Build one final image-generation prompt for a single poster.++## Requirements++- use the collected poster fields+- keep the image single-frame+- keep the composition explicit+- keep the text content explicit+- align style and color direction with the user request+- avoid adding unsupported brand claims or extra marketing facts++## Missing Data Rule++If any required field is missing, ask follow-up questions before producing the final prompt.diff --git a/skill/poster-skill/references/image-provider-config.md b/skill/poster-skill/references/image-provider-config.mdnew file mode 100644index 0000000..b632cb5--- /dev/null+++ b/skill/poster-skill/references/image-provider-config.md@@ -0,0 +1,48 @@+# Image Provider Config++Image generation uses `config/image-provider.json`.++## Required keys++- `provider`+- `apiKey`+- `model`++## Optional keys++- `baseUrl`++## File Path++- `config/image-provider.json`++## Example++```json+{+ "provider": "openai",+ "apiKey": "YOUR_KEY",+ "baseUrl": "https://api.openai.com/v1",+ "model": "gpt-image-1"+}+```++## Supported providers++- `openai`+- `aliyun`+- `tencent`+- `bytedance`+- `zhipu`+- `google`+- `xai`+- `bfl`+- `adobe`++## Rule++Do not ask the user to paste API keys into chat.++If image generation is requested and `config/image-provider.json` is missing or incomplete, stop and tell the user to fill that file.++If a reference image is provided but the selected provider or model does not support reference images, ignore the reference image and continue only if the task still makes sense without it. Do not claim that the model used the reference image when it did not.diff --git a/skill/poster-skill/references/output-contract.md b/skill/poster-skill/references/output-contract.mdnew file mode 100644index 0000000..cb33dca--- /dev/null+++ b/skill/poster-skill/references/output-contract.md@@ -0,0 +1,24 @@+# Output Contract++Default output:++- `png`+- `metadata.json`++Optional outputs:++- `jpg`+- `prompt.txt`++## Metadata++Metadata should include:++- theme+- size or aspect ratio+- style+- color direction+- provider+- model+- output file name+- generation timestampdiff --git a/skill/poster-skill/references/poster-fields.md b/skill/poster-skill/references/poster-fields.mdnew file mode 100644index 0000000..0adde0e--- /dev/null+++ b/skill/poster-skill/references/poster-fields.md@@ -0,0 +1,30 @@+# Poster Fields++Collect these fields before generation.++## Required++- `theme`+- `size` or `aspect_ratio`+- `style`+- `color_direction`+- `primary_copy`+- `reference_image_status`++## Optional++- `subtitle`+- `body_copy`+- `cta`+- `composition`+- `focal_area`+- `whitespace`+- `reference_image_url`+- `brand_name`+- `export_format`++## Rule++If any required field is missing, ask follow-up questions before generation.++If `reference_image_status` is positive, request `reference_image_url` before generation.diff --git a/skill/poster-skill/references/prompt-rules.md b/skill/poster-skill/references/prompt-rules.mdnew file mode 100644index 0000000..52b2ee2--- /dev/null+++ b/skill/poster-skill/references/prompt-rules.md@@ -0,0 +1,17 @@+# Prompt Rules++Use these rules when building the final poster generation prompt.++- Keep the output focused on one poster image.+- State the intended size or aspect ratio.+- State the visual style clearly.+- State the color direction clearly.+- State the composition and focal area clearly.+- Include the required textual content explicitly.+- Use concise, concrete visual language.+- Avoid generic filler such as "beautiful", "stunning", or "high quality" unless they add specific meaning.+- Do not invent extra brand claims, dates, or pricing.+- If the user provides a reference image, treat it as style, composition, lighting, or mood guidance.+- Do not treat a reference image as a source of facts.+- Do not infer pricing, dates, brand promises, or campaign details from a reference image.+- If the reference image conflicts with explicit user instructions, follow the explicit user instructions.diff --git a/skill/poster-skill/scripts/build-poster-bundle.mjs b/skill/poster-skill/scripts/build-poster-bundle.mjsnew file mode 100644index 0000000..93fb239--- /dev/null+++ b/skill/poster-skill/scripts/build-poster-bundle.mjs@@ -0,0 +1,93 @@+#!/usr/bin/env node++import fs from "node:fs";+import path from "node:path";+import { spawnSync } from "node:child_process";+import { fileURLToPath } from "node:url";++function parseArgs(argv) {+ const args = {+ promptFile: "",+ outDir: "",+ name: "poster",+ configFile: "",+ format: "png",+ referenceImageUrl: "",+ };+ for (let i = 0; i < argv.length; i += 1) {+ const token = argv[i];+ if (token === "--prompt-file") {+ args.promptFile = argv[i + 1] || "";+ i += 1;+ } else if (token === "--out-dir" || token === "-o") {+ args.outDir = argv[i + 1] || "";+ i += 1;+ } else if (token === "--name") {+ args.name = argv[i + 1] || args.name;+ i += 1;+ } else if (token === "--config-file") {+ args.configFile = argv[i + 1] || "";+ i += 1;+ } else if (token === "--format") {+ args.format = argv[i + 1] || args.format;+ i += 1;+ } else if (token === "--reference-image-url") {+ args.referenceImageUrl = argv[i + 1] || "";+ i += 1;+ }+ }+ return args;+}++function fail(message) {+ console.error(message);+ process.exit(1);+}++function main() {+ const args = parseArgs(process.argv.slice(2));+ if (!args.promptFile) fail("Missing --prompt-file <path-to-prompt>.");+ if (!args.outDir) fail("Missing --out-dir <bundle-directory>.");++ const promptFile = path.resolve(process.cwd(), args.promptFile);+ const outDir = path.resolve(process.cwd(), args.outDir);+ const scriptDir = path.dirname(fileURLToPath(import.meta.url));+ const generateScript = path.join(scriptDir, "generate-poster-image.mjs");+ const imagePath = path.join(outDir, `${args.name}.${args.format}`);+ const metadataPath = path.join(outDir, `${args.name}.metadata.json`);+ const promptCopyPath = path.join(outDir, `${args.name}.prompt.txt`);++ fs.mkdirSync(outDir, { recursive: true });+ fs.copyFileSync(promptFile, promptCopyPath);++ const command = [+ generateScript,+ "--prompt-file",+ promptFile,+ "--output",+ imagePath,+ "--format",+ args.format,+ ];+ if (args.configFile) {+ command.push("--config-file", path.resolve(process.cwd(), args.configFile));+ }+ if (args.referenceImageUrl) {+ command.push("--reference-image-url", args.referenceImageUrl);+ }++ const result = spawnSync(process.execPath, command, { stdio: "inherit" });+ if (result.status !== 0) fail("Poster image generation failed.");++ const metadata = {+ name: args.name,+ imageFile: path.basename(imagePath),+ promptFile: path.basename(promptCopyPath),+ generatedAt: new Date().toISOString(),+ format: args.format,+ };+ fs.writeFileSync(metadataPath, JSON.stringify(metadata, null, 2), "utf8");+ console.log(`Poster bundle written to ${outDir}`);+}++main();diff --git a/skill/poster-skill/scripts/generate-poster-image.mjs b/skill/poster-skill/scripts/generate-poster-image.mjsnew file mode 100644index 0000000..3e2ce38--- /dev/null+++ b/skill/poster-skill/scripts/generate-poster-image.mjs@@ -0,0 +1,107 @@+#!/usr/bin/env node++import fs from "node:fs";+import path from "node:path";+import { generateImageThroughGateway } from "./lib/gateway.mjs";+import { getDefaultBaseUrl } from "./lib/provider-registry.mjs";++function parseArgs(argv) {+ const args = {+ prompt: "",+ promptFile: "",+ output: "",+ format: "png",+ configFile: "",+ referenceImageUrl: "",+ };+ for (let i = 0; i < argv.length; i += 1) {+ const token = argv[i];+ if (token === "--prompt") {+ args.prompt = argv[i + 1] || "";+ i += 1;+ } else if (token === "--prompt-file") {+ args.promptFile = argv[i + 1] || "";+ i += 1;+ } else if (token === "--output" || token === "-o") {+ args.output = argv[i + 1] || "";+ i += 1;+ } else if (token === "--format" || token === "-f") {+ args.format = argv[i + 1] || args.format;+ i += 1;+ } else if (token === "--config-file") {+ args.configFile = argv[i + 1] || "";+ i += 1;+ } else if (token === "--reference-image-url") {+ args.referenceImageUrl = argv[i + 1] || "";+ i += 1;+ }+ }+ return args;+}++function fail(message) {+ console.error(message);+ process.exit(1);+}++function loadConfig(configFile) {+ const target = configFile+ ? path.resolve(process.cwd(), configFile)+ : path.resolve(process.cwd(), "config", "image-provider.json");+ if (!fs.existsSync(target)) {+ fail(`Missing provider config file: ${target}`);+ }+ return JSON.parse(fs.readFileSync(target, "utf8"));+}++function decodeDataUrl(dataUrl) {+ const match = String(dataUrl || "").match(/^data:([^;]+);base64,(.*)$/);+ if (!match) fail("Image generation did not return a base64 data URL.");+ return {+ mime: match[1],+ buffer: Buffer.from(match[2], "base64"),+ };+}++async function main() {+ const args = parseArgs(process.argv.slice(2));+ if (!args.output) fail("Missing --output <path-to-image>.");++ const prompt = args.promptFile+ ? fs.readFileSync(path.resolve(process.cwd(), args.promptFile), "utf8")+ : args.prompt;++ if (!String(prompt || "").trim()) fail("Missing prompt. Use --prompt or --prompt-file.");++ const rawConfig = loadConfig(args.configFile);+ const provider = String(rawConfig.provider || "").trim().toLowerCase();+ const apiKey = String(rawConfig.apiKey || "").trim();+ const model = String(rawConfig.model || "").trim();+ const baseUrl = String(rawConfig.baseUrl || getDefaultBaseUrl(provider) || "").trim();++ if (!provider || !apiKey || !model) {+ fail("Missing image provider configuration. Required: provider, apiKey, model.");+ }++ const dataUrl = await generateImageThroughGateway({+ channel: {+ provider,+ apiKey,+ baseUrl,+ model,+ },+ prompt,+ referenceImageUrl: args.referenceImageUrl || undefined,+ });++ const { buffer } = decodeDataUrl(dataUrl);+ const outputPath = path.resolve(process.cwd(), args.output);+ fs.mkdirSync(path.dirname(outputPath), { recursive: true });+ fs.writeFileSync(outputPath, buffer);+ console.log(`Poster image written to ${outputPath}`);+}++main().catch((error) => {+ console.error(error instanceof Error ? error.message : String(error));+ process.exit(1);+});diff --git a/skill/poster-skill/scripts/lib/gateway.mjs b/skill/poster-skill/scripts/lib/gateway.mjsnew file mode 100644index 0000000..ae80df7--- /dev/null+++ b/skill/poster-skill/scripts/lib/gateway.mjs@@ -0,0 +1,115 @@+import { resolveImageRoute } from "./provider-registry.mjs";++function joinUrl(baseUrl, endpoint) {+ const base = String(baseUrl || "").trim().replace(/\/+$/, "");+ const path = String(endpoint || "").trim();+ if (!path) return base;+ if (/^https?:\/\//i.test(path)) return path;+ if (!base) return path;+ return `${base}/${path.replace(/^\/+/, "")}`;+}++async function convertRemoteImageToDataUrl(url) {+ if (url.startsWith("data:image")) return url;+ const response = await fetch(url);+ if (!response.ok) throw new Error(`Failed to fetch remote image with status ${response.status}`);+ const contentType = response.headers.get("content-type") || "image/png";+ const buffer = Buffer.from(await response.arrayBuffer());+ return `data:${contentType};base64,${buffer.toString("base64")}`;+}++function extractImageUrlFromOpenAIContent(content) {+ if (Array.isArray(content)) {+ const imagePart = content.find((part) => part?.type === "image_url" && part?.image_url?.url);+ if (imagePart?.image_url?.url) return String(imagePart.image_url.url);+ const textPart = content.find((part) => part?.type === "text" && typeof part?.text === "string");+ if (textPart?.text) {+ const markdownMatch = textPart.text.match(/!\[.*?\]\((.*?)\)/);+ if (markdownMatch?.[1]) return markdownMatch[1];+ if (/^https?:\/\//i.test(textPart.text.trim()) || textPart.text.trim().startsWith("data:image")) {+ return textPart.text.trim();+ }+ }+ return null;+ }++ if (typeof content === "string") {+ const markdownMatch = content.match(/!\[.*?\]\((.*?)\)/);+ if (markdownMatch?.[1]) return markdownMatch[1];+ if (/^https?:\/\//i.test(content.trim()) || content.trim().startsWith("data:image")) return content.trim();+ }++ return null;+}++async function requestOpenAIImages(req) {+ const response = await fetch(joinUrl(req.channel.baseUrl, "/images/generations"), {+ method: "POST",+ headers: {+ Authorization: `Bearer ${req.channel.apiKey}`,+ "Content-Type": "application/json",+ },+ body: JSON.stringify({+ model: req.channel.model,+ prompt: req.prompt,+ }),+ });++ const text = await response.text();+ let parsed = null;+ try {+ parsed = text ? JSON.parse(text) : null;+ } catch {+ parsed = null;+ }+ if (!response.ok) {+ throw new Error(parsed?.error?.message || parsed?.error || text || `Request failed with status ${response.status}`);+ }++ const first = parsed?.data?.[0];+ if (first?.b64_json) return `data:image/png;base64,${first.b64_json}`;+ if (first?.url) return await convertRemoteImageToDataUrl(String(first.url));+ throw new Error("Image request succeeded but returned no image data.");+}++async function requestOpenAIChatImage(req) {+ const content = [{ type: "text", text: req.prompt }];+ if (req.referenceImageUrl) {+ content.push({ type: "image_url", image_url: { url: req.referenceImageUrl } });+ }++ const response = await fetch(joinUrl(req.channel.baseUrl, "/chat/completions"), {+ method: "POST",+ headers: {+ Authorization: `Bearer ${req.channel.apiKey}`,+ "Content-Type": "application/json",+ },+ body: JSON.stringify({+ model: req.channel.model,+ messages: [{ role: "user", content: content.length > 1 ? content : req.prompt }],+ stream: false,+ }),+ });++ const text = await response.text();+ let parsed = null;+ try {+ parsed = text ? JSON.parse(text) : null;+ } catch {+ parsed = null;+ }+ if (!response.ok) {+ throw new Error(parsed?.error?.message || parsed?.error || text || `Request failed with status ${response.status}`);+ }++ const url = extractImageUrlFromOpenAIContent(parsed?.choices?.[0]?.message?.content);+ if (!url) throw new Error("Image request succeeded but returned no image URL.");+ return await convertRemoteImageToDataUrl(url);+}++export async function generateImageThroughGateway(req) {+ const route = resolveImageRoute(req.channel);++ if (route.protocol === "openai-images") return await requestOpenAIImages(req);+ return await requestOpenAIChatImage(req);+}diff --git a/skill/poster-skill/scripts/lib/provider-registry.mjs b/skill/poster-skill/scripts/lib/provider-registry.mjsnew file mode 100644index 0000000..d15cd5b--- /dev/null+++ b/skill/poster-skill/scripts/lib/provider-registry.mjs@@ -0,0 +1,51 @@+function matchesRule(provider, model, rules) {+ const normalizedProvider = String(provider || "").toLowerCase();+ const normalizedModel = String(model || "");+ return rules.some(+ (rule) =>+ rule.provider === normalizedProvider &&+ rule.patterns.some((pattern) => pattern.test(normalizedModel)),+ );+}++const IMAGE_OPENAI_IMAGES_RULES = [+ { provider: "openai", patterns: [/gpt-image/i, /dall-e/i] },+];++const IMAGE_REFERENCE_RULES = [+ { provider: "openai", patterns: [/gpt-image/i] },+ { provider: "aliyun", patterns: [/wan/i, /qwen-image/i] },+ { provider: "bytedance", patterns: [/seedream/i] },+ { provider: "zhipu", patterns: [/glm-image/i, /cogview/i] },+ { provider: "tencent", patterns: [/hunyuan/i] },+];++const IMAGE_PROVIDER_OPTIONS = [+ { id: "openai", defaultBaseUrl: "https://api.openai.com/v1" },+ { id: "aliyun", defaultBaseUrl: "" },+ { id: "tencent", defaultBaseUrl: "" },+ { id: "bytedance", defaultBaseUrl: "" },+ { id: "zhipu", defaultBaseUrl: "" },+ { id: "google", defaultBaseUrl: "" },+ { id: "xai", defaultBaseUrl: "" },+ { id: "bfl", defaultBaseUrl: "" },+ { id: "adobe", defaultBaseUrl: "" },+];++export function getDefaultBaseUrl(provider) {+ return IMAGE_PROVIDER_OPTIONS.find((item) => item.id === provider)?.defaultBaseUrl || "";+}++export function resolveImageRoute(channel) {+ const provider = String(channel.provider || "").toLowerCase();+ if (!IMAGE_PROVIDER_OPTIONS.some((item) => item.id === provider)) {+ throw new Error(`Unsupported image provider: ${provider}`);+ }++ return {+ protocol: matchesRule(provider, channel.model, IMAGE_OPENAI_IMAGES_RULES)+ ? "openai-images"+ : "openai-chat-image",+ supportsReferenceImages: matchesRule(provider, channel.model, IMAGE_REFERENCE_RULES),+ };+}diff --git a/skill/ppt-skill/SKILL.md b/skill/ppt-skill/SKILL.mdnew file mode 100644index 0000000..c298366--- /dev/null+++ b/skill/ppt-skill/SKILL.md@@ -0,0 +1,131 @@+---+name: ppt-skill+description: Generate PPT templates, full presentation slide sets, and export deliverables. Use for template-only requests, full presentation generation from idea or outline, and PPT delivery in PDF or image-based PPT form.+---++# PPT Skill++## Trigger++Use when the task requires:++- one or more PPT template backgrounds+- a full presentation from idea, outline, or source documents+- slide-image-based presentation rendering+- export delivery as `pdf` or `image_ppt`++## First-Use Reminder++On the first use of this skill in a conversation, remind the user that image generation is configurable.++Image-model vendors supported in `config/image-provider.json`:++- `openai`+- `aliyun`+- `tencent`+- `bytedance`+- `zhipu`+- `google`+- `xai`+- `bfl`+- `adobe`++## Order++1. Classify the task.+2. Collect missing required fields for that task type.+3. Read the required references.+4. Produce the planning or generation prompt.+5. Generate template backgrounds or slide images.+6. Route into the requested export mode.+7. Export or bundle artifacts when requested.++## Task Types++- `template_only`+- `deck_from_idea`+- `deck_from_outline`+- `deck_from_documents`+- `deck_edit_routing`+- `export_only`++## Required References++- `references/task-types.md`+- `references/template-contract.md`+- `references/plan-schema.md`+- `references/layout-hints.md`+- `references/image-rules.md`+- `references/export-modes.md`+- `references/image-provider-config.md`++Read only the references needed for the current task type.++## Plan Contract++For full-presentation generation, every slide must include:++- `id`+- `title`+- `content`+- `description`+- `layout`+- `note`++`description` is for visual generation, not for audience-facing copy.++## Template Contract++- Template generation creates text-free 16:9 background images.+- Templates are style references, not completed slides.+- Template output may include one or more variants when the user asks for options.++## Export Contract++Supported delivery modes:++- `pdf`+- `image_ppt`++If the user does not specify an export mode, recommend `pdf` and `image_ppt` first.++## Provider Contract++- Image generation uses `config/image-provider.json`.+- Template generation and slide generation use the same image-provider config unless the user explicitly defines a split configuration.+- Require `provider`, `apiKey`, and `model`.+- Do not ask the user to paste API keys into chat.+- If image generation is requested and config is missing or incomplete, stop and tell the user to fill the config file.++## Prompts++- `prompts/template.md`+- `prompts/plan.md`+- `prompts/slide-image.md`+- `prompts/edit-router.md`++## Scripts++- `scripts/generate-ppt-template-image.mjs`+- `scripts/generate-ppt-deck-images.mjs`+- `scripts/export-pdf.mjs`+- `scripts/build-image-ppt.mjs`++If the user specifies an output directory or file path, write artifacts there.++If the user does not specify an output location, create a new output folder automatically and write all artifacts there.++Do not write generated artifacts into the skill folder.++## Deliverables++Preferred:++- `pdf`+- `pptx`+- metadata JSON++Optional on request:++- slide PNG files+- prompt textdiff --git a/skill/ppt-skill/agents/openai.yaml b/skill/ppt-skill/agents/openai.yamlnew file mode 100644index 0000000..99189b4--- /dev/null+++ b/skill/ppt-skill/agents/openai.yaml@@ -0,0 +1,7 @@+interface:+ display_name: "PPT Skill"+ short_description: "Generate PPT templates, presentation slide sets, and exportable PDF or PPT deliverables."+ default_prompt: "Use $ppt-skill to generate a PPT template or a full presentation and export it as PDF or PPT."++policy:+ allow_implicit_invocation: truediff --git a/skill/ppt-skill/config/image-provider.json b/skill/ppt-skill/config/image-provider.jsonnew file mode 100644index 0000000..ffb9855--- /dev/null+++ b/skill/ppt-skill/config/image-provider.json@@ -0,0 +1,6 @@+{+ "provider": "",+ "apiKey": "",+ "baseUrl": "",+ "model": ""+}diff --git a/skill/ppt-skill/package.json b/skill/ppt-skill/package.jsonnew file mode 100644index 0000000..ee8c7f0--- /dev/null+++ b/skill/ppt-skill/package.json@@ -0,0 +1,12 @@+{+ "name": "ppt-skill",+ "private": true,+ "version": "1.0.0",+ "type": "module",+ "scripts": {+ "generate:template": "node scripts/generate-ppt-template-image.mjs",+ "generate:deck": "node scripts/generate-ppt-deck-images.mjs",+ "export:pdf": "node scripts/export-pdf.mjs",+ "export:image-ppt": "node scripts/build-image-ppt.mjs"+ }+}diff --git a/skill/ppt-skill/prompts/edit-router.md b/skill/ppt-skill/prompts/edit-router.mdnew file mode 100644index 0000000..e138220--- /dev/null+++ b/skill/ppt-skill/prompts/edit-router.md@@ -0,0 +1,54 @@+# R - Role+You are the `PptEditRouterAgent`.++# I - Instructions+Classify user feedback into per-slide edit actions and indicate whether each action changes content, visuals, or both.++# Input+- required: `slides_summary`+- required: `user_feedback`++Each slide in `slides_summary` includes:++- `id`+- `title`+- `content`+- `description`+- `layout`+- `note`++# S - Steps+1. Parse the feedback and map it to one or more target slides.+2. For each target slide, decide whether the change is:+- `content`+- `visual`+- `both`+3. Write one concise executable instruction per target slide.+4. Preserve slide ids exactly.++# E - End Goal+Produce one routing result that downstream logic can use to update the correct slides.++# N - Narrowing+Rules (CRITICAL):+1. Output JSON only.+2. One item per targeted slide.+3. `slideId` must match an existing id in `slides_summary`.+4. Do not invent new slide ids.+5. Do not merge unrelated slide changes into one record.++# Output Format+```json+[+ {+ "slideId": "slide-2",+ "kind": "content",+ "instruction": "Tighten the bullets into three shorter points and remove jargon."+ },+ {+ "slideId": "slide-5",+ "kind": "visual",+ "instruction": "Change the visual direction to a cleaner data-story layout with more white space."+ }+]+```diff --git a/skill/ppt-skill/prompts/plan.md b/skill/ppt-skill/prompts/plan.mdnew file mode 100644index 0000000..c3623ed--- /dev/null+++ b/skill/ppt-skill/prompts/plan.md@@ -0,0 +1,81 @@+# R - Role+You are the `PptPlanAgent`.++# I - Instructions+Generate a complete `PptPlan` for rendering.++Every slide must contain:++- `id`+- `title`+- `content`+- `description`+- `layout`+- `note`++# Input+You may receive one of these input modes:++1. `deck_from_idea`+- required: `idea_prompt`+- optional: `audience`+- optional: `goal`+- optional: `tone`+- optional: `reference_files_content`+- optional: `ui_language`++2. `deck_from_outline`+- required: `outline_text`+- optional: `audience`+- optional: `goal`+- optional: `reference_files_content`+- optional: `ui_language`++3. `deck_from_documents`+- required: `source_summary` or `reference_files_content`+- optional: `deck_goal`+- optional: `audience`+- optional: `ui_language`++# S - Steps+1. Determine the input mode.+2. Build a coherent slide sequence. Prefer 6-10 slides unless the request clearly requires a different scope.+3. For each slide:+- write a concise title+- write concise visible bullets in `content`+- write a concrete visual `description` for downstream image generation+- assign one controlled `layout`+- provide a short but useful `note`+4. If source files are provided, absorb relevant facts and align terminology.+5. Keep audience-facing copy concise and suitable for presentation.+6. Keep language aligned with `ui_language`.++# E - End Goal+Produce one complete `PptPlan` JSON that is ready for template-based or direct slide-image rendering.++# N - Narrowing+Rules (CRITICAL):+1. Output JSON only.+2. Do not output image URLs.+3. Do not output export instructions.+4. Keep `id` stable if slide ids are already implied by context; otherwise use `slide-1`, `slide-2`, ...+5. `description` is for visual generation, not speaker-facing prose.+6. Use only controlled layout labels.++# Output Format+```json+{+ "type": "ppt_plan",+ "theme": "optional",+ "slides": [+ {+ "id": "slide-1",+ "title": "...",+ "content": ["...", "..."],+ "description": "...",+ "layout": "cover",+ "note": "..."+ }+ ]+}+```diff --git a/skill/ppt-skill/prompts/slide-image.md b/skill/ppt-skill/prompts/slide-image.mdnew file mode 100644index 0000000..0065c69--- /dev/null+++ b/skill/ppt-skill/prompts/slide-image.md@@ -0,0 +1,49 @@+# R - Role+You are the `PptSlideImageAgent`.++# I - Instructions+Convert one planned slide into one render-ready image-generation prompt.++The slide must remain suitable for formal presentation use.++# Input+- required: `slide`+- required: `deck_context`+- optional: `template_style_summary`+- optional: `template_image_notes`+- optional: `material_image_notes`+- optional: `material_image_urls`+- optional: `ui_language`++# S - Steps+1. Read the slide title, content, description, layout, and deck context.+2. Convert the slide into one precise 16:9 image-generation prompt.+3. Treat the template as style guidance only.+4. Use material images only when they meaningfully support the current slide.+5. Preserve readable slide text and strong hierarchy.+6. Keep language aligned with `ui_language`.++# E - End Goal+Produce one machine-usable prompt for rendering one final presentation slide image.++# N - Narrowing+Rules (CRITICAL):+1. Output JSON only.+2. Do not return rendered image URLs.+3. Do not copy template text into the slide.+4. Keep the prompt specific to one slide.+5. Default aspect ratio is `16:9`.+6. If a material image is not actually needed, do not force it into the composition.++# Output Format+```json+{+ "type": "ppt_slide_image_prompt",+ "slideId": "slide-3",+ "prompt": "...",+ "negativePrompt": "...",+ "aspectRatio": "16:9",+ "usesTemplateStyle": true,+ "usesMaterialImages": false+}+```diff --git a/skill/ppt-skill/prompts/template.md b/skill/ppt-skill/prompts/template.mdnew file mode 100644index 0000000..ccca27b--- /dev/null+++ b/skill/ppt-skill/prompts/template.md@@ -0,0 +1,61 @@+# R - Role+You are the `PptTemplateAgent`.++# I - Instructions+Generate one or more reusable PPT template background prompts for image generation.++The output is for template backgrounds only, not completed slides.++Each template prompt must describe:++- overall visual direction+- composition structure+- atmosphere+- color direction+- decorative motifs+- negative constraints++# Input+- required: `template_requirements`+- optional: `audience`+- optional: `industry`+- optional: `tone`+- optional: `brand_colors`+- optional: `reference_image_notes`+- optional: `variant_count`+- optional: `ui_language`++# S - Steps+1. Read the visual direction and use case.+2. Infer the right density for a reusable 16:9 slide background.+3. Keep the template text-free unless the user explicitly asks for branded baked-in text.+4. Make the prompt reusable across multiple slide types.+5. If multiple variants are requested, vary only the visual direction, not the task definition.+6. Keep language aligned with `ui_language`.++# E - End Goal+Produce machine-usable template prompt data for one or more text-free PPT template backgrounds.++# N - Narrowing+Rules (CRITICAL):+1. Do not output a completed slide with audience-facing copy.+2. Do not include readable text, logos, or watermarks unless explicitly requested.+3. Default aspect ratio is `16:9`.+4. Output JSON only.+5. Do not wrap the JSON in markdown code fences.++# Output Format+```json+{+ "type": "ppt_template_prompts",+ "variants": [+ {+ "id": "template-1",+ "name": "Executive blue gradient",+ "prompt": "...",+ "negativePrompt": "...",+ "aspectRatio": "16:9"+ }+ ]+}+```diff --git a/skill/ppt-skill/references/export-modes.md b/skill/ppt-skill/references/export-modes.mdnew file mode 100644index 0000000..ef32afe--- /dev/null+++ b/skill/ppt-skill/references/export-modes.md@@ -0,0 +1,33 @@+# Export Modes++Supported output modes:++- `pdf`+- `image_ppt`++## `pdf`++Use when the user wants a stable read-only presentation deliverable.++Characteristics:++- presentation-safe+- easy to share+- visually stable++## `image_ppt`++Use when the user wants a PPT file but visual fidelity matters more than editability.++Characteristics:++- each slide is delivered as an image inside a PPT+- suitable for presenting and handing off+- minimal editability++## Default rule++If the user does not specify a mode, prefer:++- `pdf`+- `image_ppt`diff --git a/skill/ppt-skill/references/image-provider-config.md b/skill/ppt-skill/references/image-provider-config.mdnew file mode 100644index 0000000..c8a0cc9--- /dev/null+++ b/skill/ppt-skill/references/image-provider-config.md@@ -0,0 +1,34 @@+# Image Provider Config++Image generation uses `config/image-provider.json`.++## Required keys++- `provider`+- `apiKey`+- `model`++## Optional keys++- `baseUrl`++## File Path++- `config/image-provider.json`++## Example++```json+{+ "provider": "openai",+ "apiKey": "YOUR_KEY",+ "baseUrl": "https://api.openai.com/v1",+ "model": "gpt-image-1"+}+```++## Rule++- template generation and slide generation read the same config file by default+- do not ask the user to paste API keys into chat+- if `provider`, `apiKey`, or `model` is missing, stop and tell the user to fill the config filediff --git a/skill/ppt-skill/references/image-rules.md b/skill/ppt-skill/references/image-rules.mdnew file mode 100644index 0000000..8d3a2d5--- /dev/null+++ b/skill/ppt-skill/references/image-rules.md@@ -0,0 +1,9 @@+# Image Rules++- Render slides as `16:9` presentation images unless the user explicitly asks for another aspect ratio.+- Keep text readable at normal presentation scale.+- Treat template images as style references only.+- Treat uploaded material images as optional supporting assets unless the user explicitly requires them.+- Do not invent factual claims, data, labels, or logos from reference images.+- Fill dead space with purposeful structure or decoration, not random clutter.+- Keep the generated result suitable for presentation delivery, not social-media poster styling by default.diff --git a/skill/ppt-skill/references/layout-hints.md b/skill/ppt-skill/references/layout-hints.mdnew file mode 100644index 0000000..9a9aa35--- /dev/null+++ b/skill/ppt-skill/references/layout-hints.md@@ -0,0 +1,23 @@+# Layout Hints++Use controlled layout hints instead of inventing arbitrary labels.++Recommended set:++- `cover`+- `title_bullets`+- `title_content`+- `two_column`+- `left_text_right_image`+- `right_text_left_image`+- `full_visual_callout`+- `timeline`+- `comparison`+- `data_story`+- `closing`++Rules:++- choose the simplest layout that supports the content+- do not use decorative layout labels that provide no rendering value+- keep layout names stable across plan and render stagesdiff --git a/skill/ppt-skill/references/plan-schema.md b/skill/ppt-skill/references/plan-schema.mdnew file mode 100644index 0000000..033491f--- /dev/null+++ b/skill/ppt-skill/references/plan-schema.md@@ -0,0 +1,26 @@+# Plan Schema++Every slide in a full presentation plan must include:++- `id`+- `title`+- `content`+- `description`+- `layout`+- `note`++## Field meaning++- `id`: stable slide identifier+- `title`: short visible slide title+- `content`: audience-facing bullet points or short lines+- `description`: visual-generation instruction for the slide image+- `layout`: controlled layout hint+- `note`: speaker note or presenter reminder++## Rules++- `content` should be concise and presentation-friendly+- `description` should specify subject, composition, style, and visual emphasis+- `note` must always exist, even if short+- avoid overlong decks unless user intent clearly requires themdiff --git a/skill/ppt-skill/references/task-types.md b/skill/ppt-skill/references/task-types.mdnew file mode 100644index 0000000..88ce41e--- /dev/null+++ b/skill/ppt-skill/references/task-types.md@@ -0,0 +1,25 @@+# Task Types++## `template_only`++Generate one or more reusable PPT template background images.++## `deck_from_idea`++Start from a loose topic, goal, or audience brief and produce a full presentation plan, then render slides.++## `deck_from_outline`++Start from a user-provided outline and convert it into a full presentation plan, then render slides.++## `deck_from_documents`++Start from uploaded or pasted source material, extract the usable facts, and convert them into a presentation plan, then render slides.++## `deck_edit_routing`++Map revision feedback to existing slide ids and classify edit types.++## `export_only`++Take existing rendered slides or prepared deck data and export in one or more supported delivery modes.diff --git a/skill/ppt-skill/references/template-contract.md b/skill/ppt-skill/references/template-contract.mdnew file mode 100644index 0000000..e193dcb--- /dev/null+++ b/skill/ppt-skill/references/template-contract.md@@ -0,0 +1,13 @@+# Template Contract++- Template output is a reusable slide background, not a completed content slide.+- Default aspect ratio is `16:9`.+- Templates should remain text-free unless the user explicitly requests branded text baked into the background.+- A template may define:+ - color direction+ - composition direction+ - visual density+ - decorative motifs+ - image treatment+- A template should not assume specific slide titles or bullet copy.+- Template generation may produce multiple variants when the user asks for options.diff --git a/skill/ppt-skill/scripts/build-image-ppt.mjs b/skill/ppt-skill/scripts/build-image-ppt.mjsnew file mode 100644index 0000000..a8053c1--- /dev/null+++ b/skill/ppt-skill/scripts/build-image-ppt.mjs@@ -0,0 +1,66 @@+#!/usr/bin/env node++import fs from "node:fs";+import path from "node:path";+import PptxGenJS from "pptxgenjs";+import { loadManifest, parseSlideSize, resolveFromCwd, fail } from "./lib/common.mjs";++function parseArgs(argv) {+ const args = {+ manifestFile: "",+ output: "",+ slideSize: "16:9",+ };+ for (let i = 0; i < argv.length; i += 1) {+ const token = argv[i];+ if (token === "--manifest-file") {+ args.manifestFile = argv[i + 1] || "";+ i += 1;+ } else if (token === "--output" || token === "-o") {+ args.output = argv[i + 1] || "";+ i += 1;+ } else if (token === "--slide-size") {+ args.slideSize = argv[i + 1] || args.slideSize;+ i += 1;+ }+ }+ return args;+}++async function main() {+ const args = parseArgs(process.argv.slice(2));+ if (!args.manifestFile) fail("Missing --manifest-file <slides.manifest.json>.");+ if (!args.output) fail("Missing --output <file.pptx>.");++ const { manifest, manifestPath } = loadManifest(args.manifestFile);+ const slides = Array.isArray(manifest?.slides) ? manifest.slides : [];+ if (slides.length === 0) fail("Manifest contains no slides.");++ const size = parseSlideSize(args.slideSize);+ const pptx = new PptxGenJS();+ pptx.layout = size.layout;+ pptx.author = "CanvasAnvil";+ pptx.subject = manifest?.name || "Presentation";+ pptx.title = manifest?.name || "Presentation";+ pptx.company = "CanvasAnvil";+ pptx.lang = "zh-CN";++ const baseDir = path.dirname(manifestPath);++ for (const item of slides) {+ const imagePath = path.resolve(baseDir, item.imageFile);+ if (!fs.existsSync(imagePath)) fail(`Missing slide image: ${imagePath}`);+ const slide = pptx.addSlide();+ slide.addImage({ path: imagePath, x: 0, y: 0, w: size.widthInches, h: size.heightInches });+ }++ const outputPath = resolveFromCwd(args.output);+ fs.mkdirSync(path.dirname(outputPath), { recursive: true });+ await pptx.writeFile({ fileName: outputPath });+ console.log(`Image PPT written to ${outputPath}`);+}++main().catch((error) => {+ console.error(error instanceof Error ? error.message : String(error));+ process.exit(1);+});diff --git a/skill/ppt-skill/scripts/export-pdf.mjs b/skill/ppt-skill/scripts/export-pdf.mjsnew file mode 100644index 0000000..5f812ff--- /dev/null+++ b/skill/ppt-skill/scripts/export-pdf.mjs@@ -0,0 +1,74 @@+#!/usr/bin/env node++import fs from "node:fs";+import path from "node:path";+import { PDFDocument } from "pdf-lib";+import { loadManifest, parseSlideSize, resolveFromCwd, fail } from "./lib/common.mjs";++function parseArgs(argv) {+ const args = {+ manifestFile: "",+ output: "",+ slideSize: "16:9",+ };+ for (let i = 0; i < argv.length; i += 1) {+ const token = argv[i];+ if (token === "--manifest-file") {+ args.manifestFile = argv[i + 1] || "";+ i += 1;+ } else if (token === "--output" || token === "-o") {+ args.output = argv[i + 1] || "";+ i += 1;+ } else if (token === "--slide-size") {+ args.slideSize = argv[i + 1] || args.slideSize;+ i += 1;+ }+ }+ return args;+}++async function embedImage(pdfDoc, bytes, imagePath) {+ const lower = imagePath.toLowerCase();+ if (lower.endsWith(".jpg") || lower.endsWith(".jpeg")) return await pdfDoc.embedJpg(bytes);+ if (lower.endsWith(".png")) return await pdfDoc.embedPng(bytes);+ try {+ return await pdfDoc.embedPng(bytes);+ } catch {+ return await pdfDoc.embedJpg(bytes);+ }+}++async function main() {+ const args = parseArgs(process.argv.slice(2));+ if (!args.manifestFile) fail("Missing --manifest-file <slides.manifest.json>.");+ if (!args.output) fail("Missing --output <file.pdf>.");++ const { manifest, manifestPath } = loadManifest(args.manifestFile);+ const slides = Array.isArray(manifest?.slides) ? manifest.slides : [];+ if (slides.length === 0) fail("Manifest contains no slides.");++ const pdfDoc = await PDFDocument.create();+ const size = parseSlideSize(args.slideSize);+ const pageWidth = size.widthInches * 72;+ const pageHeight = size.heightInches * 72;+ const baseDir = path.dirname(manifestPath);++ for (const slide of slides) {+ const imagePath = path.resolve(baseDir, slide.imageFile);+ if (!fs.existsSync(imagePath)) fail(`Missing slide image: ${imagePath}`);+ const bytes = fs.readFileSync(imagePath);+ const image = await embedImage(pdfDoc, bytes, imagePath);+ const page = pdfDoc.addPage([pageWidth, pageHeight]);+ page.drawImage(image, { x: 0, y: 0, width: pageWidth, height: pageHeight });+ }++ const outputPath = resolveFromCwd(args.output);+ fs.mkdirSync(path.dirname(outputPath), { recursive: true });+ fs.writeFileSync(outputPath, await pdfDoc.save());+ console.log(`PDF written to ${outputPath}`);+}++main().catch((error) => {+ console.error(error instanceof Error ? error.message : String(error));+ process.exit(1);+});diff --git a/skill/ppt-skill/scripts/generate-ppt-deck-images.mjs b/skill/ppt-skill/scripts/generate-ppt-deck-images.mjsnew file mode 100644index 0000000..4895de0--- /dev/null+++ b/skill/ppt-skill/scripts/generate-ppt-deck-images.mjs@@ -0,0 +1,118 @@+#!/usr/bin/env node++import fs from "node:fs";+import path from "node:path";+import { generateImageThroughGateway } from "./lib/gateway.mjs";+import {+ decodeDataUrl,+ ensureDir,+ imageExtensionFromMime,+ loadImageProviderConfig,+ readJson,+ resolveFromCwd,+ safeSlug,+ fail,+} from "./lib/common.mjs";++function parseArgs(argv) {+ const args = {+ promptsFile: "",+ outDir: "",+ configFile: "",+ name: "deck",+ defaultReferenceImageUrl: "",+ };+ for (let i = 0; i < argv.length; i += 1) {+ const token = argv[i];+ if (token === "--prompts-file") {+ args.promptsFile = argv[i + 1] || "";+ i += 1;+ } else if (token === "--out-dir" || token === "-o") {+ args.outDir = argv[i + 1] || "";+ i += 1;+ } else if (token === "--config-file") {+ args.configFile = argv[i + 1] || "";+ i += 1;+ } else if (token === "--name") {+ args.name = argv[i + 1] || args.name;+ i += 1;+ } else if (token === "--default-reference-image-url") {+ args.defaultReferenceImageUrl = argv[i + 1] || "";+ i += 1;+ }+ }+ return args;+}++function normalizePromptPayload(payload) {+ if (Array.isArray(payload)) return payload;+ if (Array.isArray(payload?.slides)) return payload.slides;+ if (Array.isArray(payload?.prompts)) return payload.prompts;+ return [];+}++async function main() {+ const args = parseArgs(process.argv.slice(2));+ if (!args.promptsFile) fail("Missing --prompts-file <json-file>.");+ if (!args.outDir) fail("Missing --out-dir <directory>.");++ const promptsPath = resolveFromCwd(args.promptsFile);+ const payload = readJson(promptsPath);+ const prompts = normalizePromptPayload(payload).filter((item) => item && typeof item === "object");+ if (prompts.length === 0) fail("No slide prompts found in prompts file.");++ const channel = loadImageProviderConfig(args.configFile);+ const outDir = resolveFromCwd(args.outDir);+ ensureDir(outDir);+ const slidesDir = path.join(outDir, "slides");+ ensureDir(slidesDir);++ const slides = [];++ for (let index = 0; index < prompts.length; index += 1) {+ const item = prompts[index];+ const slideId = String(item.slideId || item.id || `slide-${index + 1}`);+ const prompt = String(item.prompt || "").trim();+ if (!prompt) fail(`Slide prompt is empty for ${slideId}.`);+ const dataUrl = await generateImageThroughGateway({+ channel,+ prompt,+ referenceImageUrl: item.referenceImageUrl || args.defaultReferenceImageUrl || undefined,+ });+ const { mime, buffer } = decodeDataUrl(dataUrl);+ const ext = imageExtensionFromMime(mime, "png");+ const fileName = `${String(index + 1).padStart(2, "0")}-${safeSlug(slideId, `slide-${index + 1}`)}.${ext}`;+ const outputPath = path.join(slidesDir, fileName);+ fs.writeFileSync(outputPath, buffer);+ slides.push({+ slideId,+ order: index + 1,+ title: item.title || null,+ prompt,+ negativePrompt: item.negativePrompt || null,+ imageFile: path.relative(outDir, outputPath).replace(/\\/g, "/"),+ aspectRatio: item.aspectRatio || "16:9",+ usesTemplateStyle: Boolean(item.usesTemplateStyle),+ usesMaterialImages: Boolean(item.usesMaterialImages),+ });+ console.log(`Generated slide ${index + 1}/${prompts.length}: ${outputPath}`);+ }++ const manifest = {+ type: "ppt_slide_manifest",+ name: args.name,+ generatedAt: new Date().toISOString(),+ provider: channel.provider,+ model: channel.model,+ promptsFile: path.relative(outDir, promptsPath).replace(/\\/g, "/"),+ slides,+ };+ const manifestPath = path.join(outDir, "slides.manifest.json");+ fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2), "utf8");+ console.log(`Deck image manifest written to ${manifestPath}`);+}++main().catch((error) => {+ console.error(error instanceof Error ? error.message : String(error));+ process.exit(1);+});diff --git a/skill/ppt-skill/scripts/generate-ppt-template-image.mjs b/skill/ppt-skill/scripts/generate-ppt-template-image.mjsnew file mode 100644index 0000000..a4efcfc--- /dev/null+++ b/skill/ppt-skill/scripts/generate-ppt-template-image.mjs@@ -0,0 +1,142 @@+#!/usr/bin/env node++import fs from "node:fs";+import path from "node:path";+import { generateImageThroughGateway } from "./lib/gateway.mjs";+import {+ decodeDataUrl,+ ensureDir,+ imageExtensionFromMime,+ loadImageProviderConfig,+ readJson,+ resolveFromCwd,+ safeSlug,+ fail,+} from "./lib/common.mjs";++function parseArgs(argv) {+ const args = {+ prompt: "",+ promptFile: "",+ output: "",+ outDir: "",+ variantId: "",+ configFile: "",+ referenceImageUrl: "",+ name: "template",+ };+ for (let i = 0; i < argv.length; i += 1) {+ const token = argv[i];+ if (token === "--prompt") {+ args.prompt = argv[i + 1] || "";+ i += 1;+ } else if (token === "--prompt-file") {+ args.promptFile = argv[i + 1] || "";+ i += 1;+ } else if (token === "--output" || token === "-o") {+ args.output = argv[i + 1] || "";+ i += 1;+ } else if (token === "--out-dir") {+ args.outDir = argv[i + 1] || "";+ i += 1;+ } else if (token === "--variant-id") {+ args.variantId = argv[i + 1] || "";+ i += 1;+ } else if (token === "--config-file") {+ args.configFile = argv[i + 1] || "";+ i += 1;+ } else if (token === "--reference-image-url") {+ args.referenceImageUrl = argv[i + 1] || "";+ i += 1;+ } else if (token === "--name") {+ args.name = argv[i + 1] || args.name;+ i += 1;+ }+ }+ return args;+}++function resolveVariant(payload, variantId) {+ const variants = Array.isArray(payload?.variants) ? payload.variants : [];+ if (variants.length === 0) return null;+ if (!variantId) return variants[0];+ return variants.find((item) => item?.id === variantId) || null;+}++async function main() {+ const args = parseArgs(process.argv.slice(2));+ if (!args.prompt && !args.promptFile) fail("Missing prompt input. Use --prompt or --prompt-file.");+ if (!args.output && !args.outDir) fail("Missing --output <file> or --out-dir <dir>.");++ let prompt = String(args.prompt || "").trim();+ let selectedVariant = null;+ let promptSource = "";++ if (args.promptFile) {+ const promptPath = resolveFromCwd(args.promptFile);+ const raw = fs.readFileSync(promptPath, "utf8");+ promptSource = promptPath;+ if (promptPath.toLowerCase().endsWith(".json")) {+ const payload = readJson(promptPath);+ selectedVariant = resolveVariant(payload, args.variantId);+ if (!selectedVariant?.prompt) fail("Prompt JSON did not contain a usable template variant prompt.");+ prompt = String(selectedVariant.prompt || "").trim();+ } else {+ prompt = raw.trim();+ }+ }++ if (!prompt) fail("Resolved template prompt is empty.");++ const channel = loadImageProviderConfig(args.configFile);+ const dataUrl = await generateImageThroughGateway({+ channel,+ prompt,+ referenceImageUrl: args.referenceImageUrl || undefined,+ });+ const { mime, buffer } = decodeDataUrl(dataUrl);+ const ext = imageExtensionFromMime(mime, "png");++ let outputPath = "";+ if (args.output) {+ outputPath = resolveFromCwd(args.output);+ ensureDir(path.dirname(outputPath));+ } else {+ const outDir = resolveFromCwd(args.outDir);+ ensureDir(outDir);+ const fileStem = safeSlug(selectedVariant?.id || args.name, "template");+ outputPath = path.join(outDir, `${fileStem}.${ext}`);+ }++ fs.writeFileSync(outputPath, buffer);++ if (args.outDir) {+ const outDir = resolveFromCwd(args.outDir);+ const metadataPath = path.join(outDir, `${safeSlug(selectedVariant?.id || args.name, "template")}.metadata.json`);+ fs.writeFileSync(+ metadataPath,+ JSON.stringify(+ {+ type: "ppt_template_image",+ variantId: selectedVariant?.id || null,+ name: selectedVariant?.name || args.name,+ imageFile: path.basename(outputPath),+ promptSource: promptSource || null,+ generatedAt: new Date().toISOString(),+ provider: channel.provider,+ model: channel.model,+ },+ null,+ 2,+ ),+ "utf8",+ );+ }++ console.log(`Template image written to ${outputPath}`);+}++main().catch((error) => {+ console.error(error instanceof Error ? error.message : String(error));+ process.exit(1);+});diff --git a/skill/ppt-skill/scripts/lib/common.mjs b/skill/ppt-skill/scripts/lib/common.mjsnew file mode 100644index 0000000..b859087--- /dev/null+++ b/skill/ppt-skill/scripts/lib/common.mjs@@ -0,0 +1,112 @@+import fs from "node:fs";+import path from "node:path";+import { getDefaultBaseUrl as getDefaultImageBaseUrl } from "./provider-registry.mjs";++export function fail(message) {+ console.error(message);+ process.exit(1);+}++export function ensureDir(target) {+ fs.mkdirSync(target, { recursive: true });+}++export function readJson(filePath) {+ return JSON.parse(fs.readFileSync(filePath, "utf8"));+}++export function writeJson(filePath, value) {+ ensureDir(path.dirname(filePath));+ fs.writeFileSync(filePath, JSON.stringify(value, null, 2), "utf8");+}++export function resolveFromCwd(inputPath) {+ return path.resolve(process.cwd(), inputPath);+}++export function loadImageProviderConfig(configFile) {+ const target = configFile+ ? resolveFromCwd(configFile)+ : resolveFromCwd(path.join("config", "image-provider.json"));+ if (!fs.existsSync(target)) {+ fail(`Missing provider config file: ${target}`);+ }+ const raw = readJson(target);+ const provider = String(raw.provider || "").trim().toLowerCase();+ const apiKey = String(raw.apiKey || "").trim();+ const model = String(raw.model || "").trim();+ const baseUrl = String(raw.baseUrl || getDefaultImageBaseUrl(provider) || "").trim();+ if (!provider || !apiKey || !model) {+ fail("Missing image provider configuration. Required: provider, apiKey, model.");+ }+ if (provider === "custom") {+ fail("Custom image providers are not supported in ppt-skill.");+ }+ return {+ provider,+ apiKey,+ model,+ baseUrl,+ sourceFile: target,+ };+}++export function decodeDataUrl(dataUrl) {+ const match = String(dataUrl || "").match(/^data:([^;]+);base64,(.*)$/);+ if (!match) fail("Image generation did not return a base64 data URL.");+ return {+ mime: match[1],+ buffer: Buffer.from(match[2], "base64"),+ };+}++export function imageExtensionFromMime(mime, fallback = "png") {+ const normalized = String(mime || "").toLowerCase();+ if (normalized.includes("jpeg") || normalized.includes("jpg")) return "jpg";+ if (normalized.includes("webp")) return "webp";+ if (normalized.includes("png")) return "png";+ return fallback;+}++export function readPromptInput({ prompt, promptFile }) {+ if (promptFile) {+ const filePath = resolveFromCwd(promptFile);+ const text = fs.readFileSync(filePath, "utf8");+ return { text, filePath };+ }+ return { text: String(prompt || ""), filePath: "" };+}++export function safeSlug(value, fallback = "slide") {+ const normalized = String(value || "")+ .trim()+ .toLowerCase()+ .replace(/[^a-z0-9]+/g, "-")+ .replace(/^-+|-+$/g, "");+ return normalized || fallback;+}++export function loadManifest(filePath) {+ const target = resolveFromCwd(filePath);+ if (!fs.existsSync(target)) fail(`Missing manifest file: ${target}`);+ return { manifest: readJson(target), manifestPath: target };+}++export function fileToDataUrl(filePath) {+ const abs = resolveFromCwd(filePath);+ const ext = path.extname(abs).toLowerCase();+ const mime =+ ext === ".jpg" || ext === ".jpeg" ? "image/jpeg"+ : ext === ".webp" ? "image/webp"+ : "image/png";+ const buffer = fs.readFileSync(abs);+ return `data:${mime};base64,${buffer.toString("base64")}`;+}++export function parseSlideSize(value) {+ const raw = String(value || "16:9").trim();+ if (raw === "4:3") {+ return { layout: "LAYOUT_STANDARD", widthInches: 10, heightInches: 7.5, aspectRatio: raw };+ }+ return { layout: "LAYOUT_WIDE", widthInches: 13.333, heightInches: 7.5, aspectRatio: "16:9" };+}diff --git a/skill/ppt-skill/scripts/lib/gateway.mjs b/skill/ppt-skill/scripts/lib/gateway.mjsnew file mode 100644index 0000000..531b381--- /dev/null+++ b/skill/ppt-skill/scripts/lib/gateway.mjs@@ -0,0 +1,148 @@+import { resolveImageRoute } from "./provider-registry.mjs";++function joinUrl(baseUrl, endpoint) {+ const base = String(baseUrl || "").trim().replace(/\/+$/, "");+ const path = String(endpoint || "").trim();+ if (!path) return base;+ if (/^https?:\/\//i.test(path)) return path;+ if (!base) return path;+ return `${base}/${path.replace(/^\/+/, "")}`;+}++function extractByPath(input, path) {+ const normalized = String(path || "").trim();+ if (!normalized) return input;+ const tokens = normalized+ .replace(/\[(\d+)\]/g, ".$1")+ .split(".")+ .map((token) => token.trim())+ .filter(Boolean);+ let current = input;+ for (const token of tokens) {+ if (current == null) return undefined;+ current = current[token];+ }+ return current;+}++function applyTemplate(value, context) {+ if (typeof value === "string") {+ if (value.startsWith("$")) return context[value.slice(1)];+ return value.replace(/\$([a-zA-Z0-9_]+)/g, (_, key) => {+ const resolved = context[key];+ return resolved == null ? "" : typeof resolved === "string" ? resolved : JSON.stringify(resolved);+ });+ }+ if (Array.isArray(value)) return value.map((item) => applyTemplate(item, context));+ if (value && typeof value === "object") {+ const out = {};+ for (const [key, item] of Object.entries(value)) out[key] = applyTemplate(item, context);+ return out;+ }+ return value;+}++async function convertRemoteImageToDataUrl(url) {+ if (url.startsWith("data:image")) return url;+ const response = await fetch(url);+ if (!response.ok) throw new Error(`Failed to fetch remote image with status ${response.status}`);+ const contentType = response.headers.get("content-type") || "image/png";+ const buffer = Buffer.from(await response.arrayBuffer());+ return `data:${contentType};base64,${buffer.toString("base64")}`;+}++function extractImageUrlFromOpenAIContent(content) {+ if (Array.isArray(content)) {+ const imagePart = content.find((part) => part?.type === "image_url" && part?.image_url?.url);+ if (imagePart?.image_url?.url) return String(imagePart.image_url.url);+ const textPart = content.find((part) => part?.type === "text" && typeof part?.text === "string");+ if (textPart?.text) {+ const markdownMatch = textPart.text.match(/!\[.*?\]\((.*?)\)/);+ if (markdownMatch?.[1]) return markdownMatch[1];+ if (/^https?:\/\//i.test(textPart.text.trim()) || textPart.text.trim().startsWith("data:image")) {+ return textPart.text.trim();+ }+ }+ return null;+ }++ if (typeof content === "string") {+ const markdownMatch = content.match(/!\[.*?\]\((.*?)\)/);+ if (markdownMatch?.[1]) return markdownMatch[1];+ if (/^https?:\/\//i.test(content.trim()) || content.trim().startsWith("data:image")) return content.trim();+ }++ return null;+}++async function requestOpenAIImages(req) {+ const response = await fetch(joinUrl(req.channel.baseUrl, "/images/generations"), {+ method: "POST",+ headers: {+ Authorization: `Bearer ${req.channel.apiKey}`,+ "Content-Type": "application/json",+ },+ body: JSON.stringify({+ model: req.channel.model,+ prompt: req.prompt,+ }),+ });++ const text = await response.text();+ let parsed = null;+ try {+ parsed = text ? JSON.parse(text) : null;+ } catch {+ parsed = null;+ }+ if (!response.ok) {+ throw new Error(parsed?.error?.message || parsed?.error || text || `Request failed with status ${response.status}`);+ }++ const first = parsed?.data?.[0];+ if (first?.b64_json) return `data:image/png;base64,${first.b64_json}`;+ if (first?.url) return await convertRemoteImageToDataUrl(String(first.url));+ throw new Error("Image request succeeded but returned no image data.");+}++async function requestOpenAIChatImage(req) {+ const content = [{ type: "text", text: req.prompt }];+ if (req.referenceImageUrl) {+ content.push({ type: "image_url", image_url: { url: req.referenceImageUrl } });+ }++ const response = await fetch(joinUrl(req.channel.baseUrl, "/chat/completions"), {+ method: "POST",+ headers: {+ Authorization: `Bearer ${req.channel.apiKey}`,+ "Content-Type": "application/json",+ },+ body: JSON.stringify({+ model: req.channel.model,+ messages: [{ role: "user", content: content.length > 1 ? content : req.prompt }],+ stream: false,+ }),+ });++ const text = await response.text();+ let parsed = null;+ try {+ parsed = text ? JSON.parse(text) : null;+ } catch {+ parsed = null;+ }+ if (!response.ok) {+ throw new Error(parsed?.error?.message || parsed?.error || text || `Request failed with status ${response.status}`);+ }++ const url = extractImageUrlFromOpenAIContent(parsed?.choices?.[0]?.message?.content);+ if (!url) throw new Error("Image request succeeded but returned no image URL.");+ return await convertRemoteImageToDataUrl(url);+}++export async function generateImageThroughGateway(req) {+ const route = resolveImageRoute(req.channel);++ if (route.protocol === "openai-images") return await requestOpenAIImages(req);+ return await requestOpenAIChatImage(req);+}diff --git a/skill/ppt-skill/scripts/lib/provider-registry.mjs b/skill/ppt-skill/scripts/lib/provider-registry.mjsnew file mode 100644index 0000000..1ed0a0b--- /dev/null+++ b/skill/ppt-skill/scripts/lib/provider-registry.mjs@@ -0,0 +1,51 @@+function matchesRule(provider, model, rules) {+ const normalizedProvider = String(provider || "").toLowerCase();+ const normalizedModel = String(model || "");+ return rules.some(+ (rule) =>+ rule.provider === normalizedProvider &&+ rule.patterns.some((pattern) => pattern.test(normalizedModel)),+ );+}++const IMAGE_OPENAI_IMAGES_RULES = [+ { provider: "openai", patterns: [/gpt-image/i, /dall-e/i] },+];++const IMAGE_REFERENCE_RULES = [+ { provider: "openai", patterns: [/gpt-image/i] },+ { provider: "aliyun", patterns: [/wan/i, /qwen-image/i] },+ { provider: "bytedance", patterns: [/seedream/i] },+ { provider: "zhipu", patterns: [/glm-image/i, /cogview/i] },+ { provider: "tencent", patterns: [/hunyuan/i] },+];++const IMAGE_PROVIDER_OPTIONS = [+ { id: "openai", defaultBaseUrl: "https://api.openai.com/v1" },+ { id: "aliyun", defaultBaseUrl: "" },+ { id: "tencent", defaultBaseUrl: "" },+ { id: "bytedance", defaultBaseUrl: "" },+ { id: "zhipu", defaultBaseUrl: "" },+ { id: "google", defaultBaseUrl: "" },+ { id: "xai", defaultBaseUrl: "" },+ { id: "bfl", defaultBaseUrl: "" },+ { id: "adobe", defaultBaseUrl: "" },+];++export function getDefaultBaseUrl(provider) {+ return IMAGE_PROVIDER_OPTIONS.find((item) => item.id === provider)?.defaultBaseUrl || "";+}++export function resolveImageRoute(channel) {+ const provider = String(channel.provider || "").toLowerCase();+ if (provider === "custom") {+ throw new Error("Custom image providers are not supported in ppt-skill.");+ }++ return {+ protocol: matchesRule(provider, channel.model, IMAGE_OPENAI_IMAGES_RULES)+ ? "openai-images"+ : "openai-chat-image",+ supportsReferenceImages: matchesRule(provider, channel.model, IMAGE_REFERENCE_RULES),+ };+}diff --git a/skill/product-skill/SKILL.md b/skill/product-skill/SKILL.mdnew file mode 100644index 0000000..ecf8111--- /dev/null+++ b/skill/product-skill/SKILL.md@@ -0,0 +1,93 @@+---+name: product-skill+description: Generate final product visual images from structured requirements. Use for single product hero visuals, launch graphics, feature callout boards, spec visuals, and other single-frame product graphics that should export directly to local image files.+---++# Product Skill++## Trigger++Use when the task requires one final product visual image.++## First-Use Reminder++On the first use of this skill in a conversation, remind the user that image generation is configurable and tell them which model vendors are supported in `config/image-provider.json`.++Supported vendors:++- `openai`+- `aliyun`+- `tencent`+- `bytedance`+- `zhipu`+- `google`+- `xai`+- `bfl`+- `adobe`++## Order++1. Confirm the task is a product visual task.+2. Collect required fields.+3. Ask follow-up questions for missing required fields.+4. Read the required references.+5. Produce the final product visual prompt.+6. Generate the image through the configured provider.+7. Export or bundle artifacts when requested.++## Required Fields++- `product_name`+- `size` or `aspect_ratio`+- `style_direction`+- `color_direction`+- `selling_points`+- `product_image_status`+- `reference_image_status`++Do not guess missing required fields.++## Required References++- `references/product-fields.md`+- `references/prompt-rules.md`+- `references/image-provider-config.md`+- `references/output-contract.md`++## Prompt Contract++- Produce one final product visual prompt.+- Keep the output specific to one frame.+- Keep the product subject explicit.+- Include composition, focal area, lighting, and background direction.+- Keep provided copy and selling points explicit.+- Do not invent unsupported claims, pricing, certifications, or brand facts.+- Treat reference images as visual guidance only.+- Do not treat reference images as factual sources for copy, branding, pricing, specifications, or claims.++## Provider Contract++- Use the configured image provider for image generation.+- Require `config/image-provider.json` before image generation.+- Do not ask the user to paste API keys into chat.+- Stop and tell the user to fill `config/image-provider.json` when provider, apiKey, or model is missing.+- Request `product_image_url` when `product_image_status` is positive.+- Request `reference_image_url` when `reference_image_status` is positive.+- Pass `product_image_url` and `reference_image_url` only when usable URLs are available and the selected provider path supports them.++## Scripts++- `scripts/generate-product-image.mjs`+- `scripts/build-product-bundle.mjs`++## Deliverables++Preferred:++- `png`+- metadata JSON++Optional on request:++- `jpg`+- prompt textdiff --git a/skill/product-skill/agents/openai.yaml b/skill/product-skill/agents/openai.yamlnew file mode 100644index 0000000..efc89dd--- /dev/null+++ b/skill/product-skill/agents/openai.yaml@@ -0,0 +1,7 @@+interface:+ display_name: "Product Skill"+ short_description: "Generate single-frame product visuals with provider-based image routing and local export."+ default_prompt: "Use $product-skill to generate a final product visual image and save it locally."++policy:+ allow_implicit_invocation: truediff --git a/skill/product-skill/config/image-provider.json b/skill/product-skill/config/image-provider.jsonnew file mode 100644index 0000000..ffb9855--- /dev/null+++ b/skill/product-skill/config/image-provider.json@@ -0,0 +1,6 @@+{+ "provider": "",+ "apiKey": "",+ "baseUrl": "",+ "model": ""+}diff --git a/skill/product-skill/package.json b/skill/product-skill/package.jsonnew file mode 100644index 0000000..e3a0adc--- /dev/null+++ b/skill/product-skill/package.json@@ -0,0 +1,10 @@+{+ "name": "product-skill",+ "private": true,+ "version": "1.0.0",+ "type": "module",+ "scripts": {+ "generate:image": "node scripts/generate-product-image.mjs",+ "build:bundle": "node scripts/build-product-bundle.mjs"+ }+}diff --git a/skill/product-skill/prompts/generate.md b/skill/product-skill/prompts/generate.mdnew file mode 100644index 0000000..0debba8--- /dev/null+++ b/skill/product-skill/prompts/generate.md@@ -0,0 +1,16 @@+# Product Generation Prompt++Build one final image-generation prompt for a single product visual.++## Requirements++- use the collected product fields+- keep the image single-frame+- keep the product subject explicit+- keep the composition, lighting, and background explicit+- keep the text content and selling points explicit+- avoid adding unsupported facts or claims++## Missing Data Rule++If any required field is missing, ask follow-up questions before producing the final prompt.diff --git a/skill/product-skill/references/image-provider-config.md b/skill/product-skill/references/image-provider-config.mdnew file mode 100644index 0000000..e667afa--- /dev/null+++ b/skill/product-skill/references/image-provider-config.md@@ -0,0 +1,48 @@+# Image Provider Config++Image generation uses `config/image-provider.json`.++## Required keys++- `provider`+- `apiKey`+- `model`++## Optional keys++- `baseUrl`++## File Path++- `config/image-provider.json`++## Example++```json+{+ "provider": "openai",+ "apiKey": "YOUR_KEY",+ "baseUrl": "https://api.openai.com/v1",+ "model": "gpt-image-1"+}+```++## Supported providers++- `openai`+- `aliyun`+- `tencent`+- `bytedance`+- `zhipu`+- `google`+- `xai`+- `bfl`+- `adobe`++## Rule++Do not ask the user to paste API keys into chat.++If image generation is requested and `config/image-provider.json` is missing or incomplete, stop and tell the user to fill that file.++If a reference image or product image is provided but the selected provider or model does not support reference images, ignore those images and continue only if the task still makes sense without them. Do not claim that the model used those images when it did not.diff --git a/skill/product-skill/references/output-contract.md b/skill/product-skill/references/output-contract.mdnew file mode 100644index 0000000..11875e0--- /dev/null+++ b/skill/product-skill/references/output-contract.md@@ -0,0 +1,24 @@+# Output Contract++Default output:++- `png`+- `metadata.json`++Optional outputs:++- `jpg`+- `prompt.txt`++## Metadata++Metadata should include:++- product_name+- size or aspect ratio+- style+- color direction+- provider+- model+- output file name+- generation timestampdiff --git a/skill/product-skill/references/product-fields.md b/skill/product-skill/references/product-fields.mdnew file mode 100644index 0000000..565a3a2--- /dev/null+++ b/skill/product-skill/references/product-fields.md@@ -0,0 +1,35 @@+# Product Fields++Collect these fields before generation.++## Required++- `product_name`+- `size` or `aspect_ratio`+- `style_direction`+- `color_direction`+- `selling_points`+- `product_image_status`++## Optional++- `headline`+- `subtitle`+- `body_copy`+- `cta`+- `background_type`+- `lighting_direction`+- `composition`+- `focal_area`+- `reference_image_status`+- `reference_image_url`+- `product_image_url`+- `export_format`++## Rule++If any required field is missing, ask follow-up questions before generation.++If `reference_image_status` is positive, request `reference_image_url` before generation.++If `product_image_status` is positive, request `product_image_url` before generation.diff --git a/skill/product-skill/references/prompt-rules.md b/skill/product-skill/references/prompt-rules.mdnew file mode 100644index 0000000..5b35d3f--- /dev/null+++ b/skill/product-skill/references/prompt-rules.md@@ -0,0 +1,19 @@+# Prompt Rules++Use these rules when building the final product visual generation prompt.++- Keep the output focused on one product image.+- State the intended size or aspect ratio.+- State the visual style clearly.+- State the color direction clearly.+- State the composition, focal area, and lighting clearly.+- State the background direction clearly.+- Include the product subject explicitly.+- Include the provided copy and selling points explicitly.+- Use concise, concrete visual language.+- Prioritize product visibility, clarity, and hierarchy over decorative effects.+- Do not invent extra claims, specs, pricing, certifications, or dates.+- If the user provides a reference image, treat it as style, composition, lighting, or mood guidance.+- Do not treat a reference image as a source of facts.+- If the reference image conflicts with explicit user instructions, follow the explicit user instructions.+- If a product image is provided, treat it as the primary subject reference and preserve the intended product identity.diff --git a/skill/product-skill/scripts/build-product-bundle.mjs b/skill/product-skill/scripts/build-product-bundle.mjsnew file mode 100644index 0000000..b03be28--- /dev/null+++ b/skill/product-skill/scripts/build-product-bundle.mjs@@ -0,0 +1,100 @@+#!/usr/bin/env node++import fs from "node:fs";+import path from "node:path";+import { spawnSync } from "node:child_process";+import { fileURLToPath } from "node:url";++function parseArgs(argv) {+ const args = {+ promptFile: "",+ outDir: "",+ name: "product-visual",+ configFile: "",+ format: "png",+ referenceImageUrl: "",+ productImageUrl: "",+ };+ for (let i = 0; i < argv.length; i += 1) {+ const token = argv[i];+ if (token === "--prompt-file") {+ args.promptFile = argv[i + 1] || "";+ i += 1;+ } else if (token === "--out-dir" || token === "-o") {+ args.outDir = argv[i + 1] || "";+ i += 1;+ } else if (token === "--name") {+ args.name = argv[i + 1] || args.name;+ i += 1;+ } else if (token === "--config-file") {+ args.configFile = argv[i + 1] || "";+ i += 1;+ } else if (token === "--format") {+ args.format = argv[i + 1] || args.format;+ i += 1;+ } else if (token === "--reference-image-url") {+ args.referenceImageUrl = argv[i + 1] || "";+ i += 1;+ } else if (token === "--product-image-url") {+ args.productImageUrl = argv[i + 1] || "";+ i += 1;+ }+ }+ return args;+}++function fail(message) {+ console.error(message);+ process.exit(1);+}++function main() {+ const args = parseArgs(process.argv.slice(2));+ if (!args.promptFile) fail("Missing --prompt-file <path-to-prompt>.");+ if (!args.outDir) fail("Missing --out-dir <bundle-directory>.");++ const promptFile = path.resolve(process.cwd(), args.promptFile);+ const outDir = path.resolve(process.cwd(), args.outDir);+ const scriptDir = path.dirname(fileURLToPath(import.meta.url));+ const generateScript = path.join(scriptDir, "generate-product-image.mjs");+ const imagePath = path.join(outDir, `${args.name}.${args.format}`);+ const metadataPath = path.join(outDir, `${args.name}.metadata.json`);+ const promptCopyPath = path.join(outDir, `${args.name}.prompt.txt`);++ fs.mkdirSync(outDir, { recursive: true });+ fs.copyFileSync(promptFile, promptCopyPath);++ const command = [+ generateScript,+ "--prompt-file",+ promptFile,+ "--output",+ imagePath,+ "--format",+ args.format,+ ];+ if (args.configFile) {+ command.push("--config-file", path.resolve(process.cwd(), args.configFile));+ }+ if (args.referenceImageUrl) {+ command.push("--reference-image-url", args.referenceImageUrl);+ }+ if (args.productImageUrl) {+ command.push("--product-image-url", args.productImageUrl);+ }++ const result = spawnSync(process.execPath, command, { stdio: "inherit" });+ if (result.status !== 0) fail("Product image generation failed.");++ const metadata = {+ name: args.name,+ imageFile: path.basename(imagePath),+ promptFile: path.basename(promptCopyPath),+ generatedAt: new Date().toISOString(),+ format: args.format,+ };+ fs.writeFileSync(metadataPath, JSON.stringify(metadata, null, 2), "utf8");+ console.log(`Product bundle written to ${outDir}`);+}++main();diff --git a/skill/product-skill/scripts/generate-product-image.mjs b/skill/product-skill/scripts/generate-product-image.mjsnew file mode 100644index 0000000..3bf10b3--- /dev/null+++ b/skill/product-skill/scripts/generate-product-image.mjs@@ -0,0 +1,111 @@+#!/usr/bin/env node++import fs from "node:fs";+import path from "node:path";+import { generateImageThroughGateway } from "./lib/gateway.mjs";+import { getDefaultBaseUrl } from "./lib/provider-registry.mjs";++function parseArgs(argv) {+ const args = {+ prompt: "",+ promptFile: "",+ output: "",+ format: "png",+ configFile: "",+ referenceImageUrl: "",+ productImageUrl: "",+ };+ for (let i = 0; i < argv.length; i += 1) {+ const token = argv[i];+ if (token === "--prompt") {+ args.prompt = argv[i + 1] || "";+ i += 1;+ } else if (token === "--prompt-file") {+ args.promptFile = argv[i + 1] || "";+ i += 1;+ } else if (token === "--output" || token === "-o") {+ args.output = argv[i + 1] || "";+ i += 1;+ } else if (token === "--format" || token === "-f") {+ args.format = argv[i + 1] || args.format;+ i += 1;+ } else if (token === "--config-file") {+ args.configFile = argv[i + 1] || "";+ i += 1;+ } else if (token === "--reference-image-url") {+ args.referenceImageUrl = argv[i + 1] || "";+ i += 1;+ } else if (token === "--product-image-url") {+ args.productImageUrl = argv[i + 1] || "";+ i += 1;+ }+ }+ return args;+}++function fail(message) {+ console.error(message);+ process.exit(1);+}++function loadConfig(configFile) {+ const target = configFile+ ? path.resolve(process.cwd(), configFile)+ : path.resolve(process.cwd(), "config", "image-provider.json");+ if (!fs.existsSync(target)) {+ fail(`Missing provider config file: ${target}`);+ }+ return JSON.parse(fs.readFileSync(target, "utf8"));+}++function decodeDataUrl(dataUrl) {+ const match = String(dataUrl || "").match(/^data:([^;]+);base64,(.*)$/);+ if (!match) fail("Image generation did not return a base64 data URL.");+ return {+ buffer: Buffer.from(match[2], "base64"),+ };+}++async function main() {+ const args = parseArgs(process.argv.slice(2));+ if (!args.output) fail("Missing --output <path-to-image>.");++ const prompt = args.promptFile+ ? fs.readFileSync(path.resolve(process.cwd(), args.promptFile), "utf8")+ : args.prompt;++ if (!String(prompt || "").trim()) fail("Missing prompt. Use --prompt or --prompt-file.");++ const rawConfig = loadConfig(args.configFile);+ const provider = String(rawConfig.provider || "").trim().toLowerCase();+ const apiKey = String(rawConfig.apiKey || "").trim();+ const model = String(rawConfig.model || "").trim();+ const baseUrl = String(rawConfig.baseUrl || getDefaultBaseUrl(provider) || "").trim();++ if (!provider || !apiKey || !model) {+ fail("Missing image provider configuration. Required: provider, apiKey, model.");+ }++ const dataUrl = await generateImageThroughGateway({+ channel: {+ provider,+ apiKey,+ baseUrl,+ model,+ },+ prompt,+ referenceImageUrl: args.referenceImageUrl || undefined,+ productImageUrl: args.productImageUrl || undefined,+ });++ const { buffer } = decodeDataUrl(dataUrl);+ const outputPath = path.resolve(process.cwd(), args.output);+ fs.mkdirSync(path.dirname(outputPath), { recursive: true });+ fs.writeFileSync(outputPath, buffer);+ console.log(`Product image written to ${outputPath}`);+}++main().catch((error) => {+ console.error(error instanceof Error ? error.message : String(error));+ process.exit(1);+});diff --git a/skill/product-skill/scripts/lib/gateway.mjs b/skill/product-skill/scripts/lib/gateway.mjsnew file mode 100644index 0000000..236159e--- /dev/null+++ b/skill/product-skill/scripts/lib/gateway.mjs@@ -0,0 +1,118 @@+import { resolveImageRoute } from "./provider-registry.mjs";++function joinUrl(baseUrl, endpoint) {+ const base = String(baseUrl || "").trim().replace(/\/+$/, "");+ const path = String(endpoint || "").trim();+ if (!path) return base;+ if (/^https?:\/\//i.test(path)) return path;+ if (!base) return path;+ return `${base}/${path.replace(/^\/+/, "")}`;+}++async function convertRemoteImageToDataUrl(url) {+ if (url.startsWith("data:image")) return url;+ const response = await fetch(url);+ if (!response.ok) throw new Error(`Failed to fetch remote image with status ${response.status}`);+ const contentType = response.headers.get("content-type") || "image/png";+ const buffer = Buffer.from(await response.arrayBuffer());+ return `data:${contentType};base64,${buffer.toString("base64")}`;+}++function extractImageUrlFromOpenAIContent(content) {+ if (Array.isArray(content)) {+ const imagePart = content.find((part) => part?.type === "image_url" && part?.image_url?.url);+ if (imagePart?.image_url?.url) return String(imagePart.image_url.url);+ const textPart = content.find((part) => part?.type === "text" && typeof part?.text === "string");+ if (textPart?.text) {+ const markdownMatch = textPart.text.match(/!\[.*?\]\((.*?)\)/);+ if (markdownMatch?.[1]) return markdownMatch[1];+ if (/^https?:\/\//i.test(textPart.text.trim()) || textPart.text.trim().startsWith("data:image")) {+ return textPart.text.trim();+ }+ }+ return null;+ }++ if (typeof content === "string") {+ const markdownMatch = content.match(/!\[.*?\]\((.*?)\)/);+ if (markdownMatch?.[1]) return markdownMatch[1];+ if (/^https?:\/\//i.test(content.trim()) || content.trim().startsWith("data:image")) return content.trim();+ }++ return null;+}++async function requestOpenAIImages(req) {+ const response = await fetch(joinUrl(req.channel.baseUrl, "/images/generations"), {+ method: "POST",+ headers: {+ Authorization: `Bearer ${req.channel.apiKey}`,+ "Content-Type": "application/json",+ },+ body: JSON.stringify({+ model: req.channel.model,+ prompt: req.prompt,+ }),+ });++ const text = await response.text();+ let parsed = null;+ try {+ parsed = text ? JSON.parse(text) : null;+ } catch {+ parsed = null;+ }+ if (!response.ok) {+ throw new Error(parsed?.error?.message || parsed?.error || text || `Request failed with status ${response.status}`);+ }++ const first = parsed?.data?.[0];+ if (first?.b64_json) return `data:image/png;base64,${first.b64_json}`;+ if (first?.url) return await convertRemoteImageToDataUrl(String(first.url));+ throw new Error("Image request succeeded but returned no image data.");+}++async function requestOpenAIChatImage(req) {+ const content = [{ type: "text", text: req.prompt }];+ if (req.referenceImageUrl) {+ content.push({ type: "image_url", image_url: { url: req.referenceImageUrl } });+ }+ if (req.productImageUrl) {+ content.push({ type: "image_url", image_url: { url: req.productImageUrl } });+ }++ const response = await fetch(joinUrl(req.channel.baseUrl, "/chat/completions"), {+ method: "POST",+ headers: {+ Authorization: `Bearer ${req.channel.apiKey}`,+ "Content-Type": "application/json",+ },+ body: JSON.stringify({+ model: req.channel.model,+ messages: [{ role: "user", content: content.length > 1 ? content : req.prompt }],+ stream: false,+ }),+ });++ const text = await response.text();+ let parsed = null;+ try {+ parsed = text ? JSON.parse(text) : null;+ } catch {+ parsed = null;+ }+ if (!response.ok) {+ throw new Error(parsed?.error?.message || parsed?.error || text || `Request failed with status ${response.status}`);+ }++ const url = extractImageUrlFromOpenAIContent(parsed?.choices?.[0]?.message?.content);+ if (!url) throw new Error("Image request succeeded but returned no image URL.");+ return await convertRemoteImageToDataUrl(url);+}++export async function generateImageThroughGateway(req) {+ const route = resolveImageRoute(req.channel);++ if (route.protocol === "openai-images") return await requestOpenAIImages(req);+ return await requestOpenAIChatImage(req);+}diff --git a/skill/product-skill/scripts/lib/provider-registry.mjs b/skill/product-skill/scripts/lib/provider-registry.mjsnew file mode 100644index 0000000..d15cd5b--- /dev/null+++ b/skill/product-skill/scripts/lib/provider-registry.mjs@@ -0,0 +1,51 @@+function matchesRule(provider, model, rules) {+ const normalizedProvider = String(provider || "").toLowerCase();+ const normalizedModel = String(model || "");+ return rules.some(+ (rule) =>+ rule.provider === normalizedProvider &&+ rule.patterns.some((pattern) => pattern.test(normalizedModel)),+ );+}++const IMAGE_OPENAI_IMAGES_RULES = [+ { provider: "openai", patterns: [/gpt-image/i, /dall-e/i] },+];++const IMAGE_REFERENCE_RULES = [+ { provider: "openai", patterns: [/gpt-image/i] },+ { provider: "aliyun", patterns: [/wan/i, /qwen-image/i] },+ { provider: "bytedance", patterns: [/seedream/i] },+ { provider: "zhipu", patterns: [/glm-image/i, /cogview/i] },+ { provider: "tencent", patterns: [/hunyuan/i] },+];++const IMAGE_PROVIDER_OPTIONS = [+ { id: "openai", defaultBaseUrl: "https://api.openai.com/v1" },+ { id: "aliyun", defaultBaseUrl: "" },+ { id: "tencent", defaultBaseUrl: "" },+ { id: "bytedance", defaultBaseUrl: "" },+ { id: "zhipu", defaultBaseUrl: "" },+ { id: "google", defaultBaseUrl: "" },+ { id: "xai", defaultBaseUrl: "" },+ { id: "bfl", defaultBaseUrl: "" },+ { id: "adobe", defaultBaseUrl: "" },+];++export function getDefaultBaseUrl(provider) {+ return IMAGE_PROVIDER_OPTIONS.find((item) => item.id === provider)?.defaultBaseUrl || "";+}++export function resolveImageRoute(channel) {+ const provider = String(channel.provider || "").toLowerCase();+ if (!IMAGE_PROVIDER_OPTIONS.some((item) => item.id === provider)) {+ throw new Error(`Unsupported image provider: ${provider}`);+ }++ return {+ protocol: matchesRule(provider, channel.model, IMAGE_OPENAI_IMAGES_RULES)+ ? "openai-images"+ : "openai-chat-image",+ supportsReferenceImages: matchesRule(provider, channel.model, IMAGE_REFERENCE_RULES),+ };+}