sysmledgraph 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +71 -0
- package/dist/bin/cli.d.ts +6 -0
- package/dist/bin/cli.d.ts.map +1 -0
- package/dist/bin/cli.js +61 -0
- package/dist/bin/cli.js.map +1 -0
- package/dist/mcp/index.d.ts +3 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +8 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/src/cli/commands.d.ts +22 -0
- package/dist/src/cli/commands.d.ts.map +1 -0
- package/dist/src/cli/commands.js +87 -0
- package/dist/src/cli/commands.js.map +1 -0
- package/dist/src/discovery/find-sysml.d.ts +16 -0
- package/dist/src/discovery/find-sysml.d.ts.map +1 -0
- package/dist/src/discovery/find-sysml.js +30 -0
- package/dist/src/discovery/find-sysml.js.map +1 -0
- package/dist/src/discovery/load-order.d.ts +11 -0
- package/dist/src/discovery/load-order.d.ts.map +1 -0
- package/dist/src/discovery/load-order.js +85 -0
- package/dist/src/discovery/load-order.js.map +1 -0
- package/dist/src/graph/connection.d.ts +6 -0
- package/dist/src/graph/connection.d.ts.map +1 -0
- package/dist/src/graph/connection.js +7 -0
- package/dist/src/graph/connection.js.map +1 -0
- package/dist/src/graph/graph-store.d.ts +37 -0
- package/dist/src/graph/graph-store.d.ts.map +1 -0
- package/dist/src/graph/graph-store.js +108 -0
- package/dist/src/graph/graph-store.js.map +1 -0
- package/dist/src/graph/schema.d.ts +13 -0
- package/dist/src/graph/schema.d.ts.map +1 -0
- package/dist/src/graph/schema.js +21 -0
- package/dist/src/graph/schema.js.map +1 -0
- package/dist/src/index.d.ts +14 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +14 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/indexer/indexer.d.ts +20 -0
- package/dist/src/indexer/indexer.d.ts.map +1 -0
- package/dist/src/indexer/indexer.js +56 -0
- package/dist/src/indexer/indexer.js.map +1 -0
- package/dist/src/indexer/pipeline-phases.d.ts +8 -0
- package/dist/src/indexer/pipeline-phases.d.ts.map +1 -0
- package/dist/src/indexer/pipeline-phases.js +14 -0
- package/dist/src/indexer/pipeline-phases.js.map +1 -0
- package/dist/src/mcp/resources/context.d.ts +6 -0
- package/dist/src/mcp/resources/context.d.ts.map +1 -0
- package/dist/src/mcp/resources/context.js +45 -0
- package/dist/src/mcp/resources/context.js.map +1 -0
- package/dist/src/mcp/resources/schema.d.ts +6 -0
- package/dist/src/mcp/resources/schema.d.ts.map +1 -0
- package/dist/src/mcp/resources/schema.js +14 -0
- package/dist/src/mcp/resources/schema.js.map +1 -0
- package/dist/src/mcp/server.d.ts +8 -0
- package/dist/src/mcp/server.d.ts.map +1 -0
- package/dist/src/mcp/server.js +175 -0
- package/dist/src/mcp/server.js.map +1 -0
- package/dist/src/mcp/tools/clean-index.d.ts +12 -0
- package/dist/src/mcp/tools/clean-index.d.ts.map +1 -0
- package/dist/src/mcp/tools/clean-index.js +22 -0
- package/dist/src/mcp/tools/clean-index.js.map +1 -0
- package/dist/src/mcp/tools/context.d.ts +14 -0
- package/dist/src/mcp/tools/context.d.ts.map +1 -0
- package/dist/src/mcp/tools/context.js +51 -0
- package/dist/src/mcp/tools/context.js.map +1 -0
- package/dist/src/mcp/tools/cypher.d.ts +13 -0
- package/dist/src/mcp/tools/cypher.d.ts.map +1 -0
- package/dist/src/mcp/tools/cypher.js +25 -0
- package/dist/src/mcp/tools/cypher.js.map +1 -0
- package/dist/src/mcp/tools/generate-map.d.ts +13 -0
- package/dist/src/mcp/tools/generate-map.d.ts.map +1 -0
- package/dist/src/mcp/tools/generate-map.js +96 -0
- package/dist/src/mcp/tools/generate-map.js.map +1 -0
- package/dist/src/mcp/tools/impact.d.ts +14 -0
- package/dist/src/mcp/tools/impact.d.ts.map +1 -0
- package/dist/src/mcp/tools/impact.js +47 -0
- package/dist/src/mcp/tools/impact.js.map +1 -0
- package/dist/src/mcp/tools/index-db-graph.d.ts +14 -0
- package/dist/src/mcp/tools/index-db-graph.d.ts.map +1 -0
- package/dist/src/mcp/tools/index-db-graph.js +32 -0
- package/dist/src/mcp/tools/index-db-graph.js.map +1 -0
- package/dist/src/mcp/tools/list-indexed.d.ts +9 -0
- package/dist/src/mcp/tools/list-indexed.d.ts.map +1 -0
- package/dist/src/mcp/tools/list-indexed.js +14 -0
- package/dist/src/mcp/tools/list-indexed.js.map +1 -0
- package/dist/src/mcp/tools/query.d.ts +14 -0
- package/dist/src/mcp/tools/query.d.ts.map +1 -0
- package/dist/src/mcp/tools/query.js +47 -0
- package/dist/src/mcp/tools/query.js.map +1 -0
- package/dist/src/mcp/tools/rename.d.ts +19 -0
- package/dist/src/mcp/tools/rename.d.ts.map +1 -0
- package/dist/src/mcp/tools/rename.js +46 -0
- package/dist/src/mcp/tools/rename.js.map +1 -0
- package/dist/src/parser/lsp-client.d.ts +52 -0
- package/dist/src/parser/lsp-client.d.ts.map +1 -0
- package/dist/src/parser/lsp-client.js +230 -0
- package/dist/src/parser/lsp-client.js.map +1 -0
- package/dist/src/parser/lsp-server-path.d.ts +10 -0
- package/dist/src/parser/lsp-server-path.d.ts.map +1 -0
- package/dist/src/parser/lsp-server-path.js +29 -0
- package/dist/src/parser/lsp-server-path.js.map +1 -0
- package/dist/src/parser/symbols.d.ts +13 -0
- package/dist/src/parser/symbols.d.ts.map +1 -0
- package/dist/src/parser/symbols.js +150 -0
- package/dist/src/parser/symbols.js.map +1 -0
- package/dist/src/parser/sysml-mcp-client.d.ts +109 -0
- package/dist/src/parser/sysml-mcp-client.d.ts.map +1 -0
- package/dist/src/parser/sysml-mcp-client.js +185 -0
- package/dist/src/parser/sysml-mcp-client.js.map +1 -0
- package/dist/src/storage/clean.d.ts +15 -0
- package/dist/src/storage/clean.d.ts.map +1 -0
- package/dist/src/storage/clean.js +44 -0
- package/dist/src/storage/clean.js.map +1 -0
- package/dist/src/storage/list.d.ts +9 -0
- package/dist/src/storage/list.d.ts.map +1 -0
- package/dist/src/storage/list.js +12 -0
- package/dist/src/storage/list.js.map +1 -0
- package/dist/src/storage/location.d.ts +22 -0
- package/dist/src/storage/location.d.ts.map +1 -0
- package/dist/src/storage/location.js +36 -0
- package/dist/src/storage/location.js.map +1 -0
- package/dist/src/storage/registry.d.ts +14 -0
- package/dist/src/storage/registry.d.ts.map +1 -0
- package/dist/src/storage/registry.js +59 -0
- package/dist/src/storage/registry.js.map +1 -0
- package/dist/src/symbol-to-graph/mapping.d.ts +17 -0
- package/dist/src/symbol-to-graph/mapping.d.ts.map +1 -0
- package/dist/src/symbol-to-graph/mapping.js +102 -0
- package/dist/src/symbol-to-graph/mapping.js.map +1 -0
- package/dist/src/types.d.ts +40 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +35 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/worker/client.d.ts +21 -0
- package/dist/src/worker/client.d.ts.map +1 -0
- package/dist/src/worker/client.js +126 -0
- package/dist/src/worker/client.js.map +1 -0
- package/dist/src/worker/gateway.d.ts +79 -0
- package/dist/src/worker/gateway.d.ts.map +1 -0
- package/dist/src/worker/gateway.js +93 -0
- package/dist/src/worker/gateway.js.map +1 -0
- package/dist/src/worker/graph-worker.d.ts +7 -0
- package/dist/src/worker/graph-worker.d.ts.map +1 -0
- package/dist/src/worker/graph-worker.js +91 -0
- package/dist/src/worker/graph-worker.js.map +1 -0
- package/dist/src/worker/protocol.d.ts +21 -0
- package/dist/src/worker/protocol.d.ts.map +1 -0
- package/dist/src/worker/protocol.js +9 -0
- package/dist/src/worker/protocol.js.map +1 -0
- package/docs/INSTALL.md +16 -0
- package/docs/MCP_CLIENT_TEMPLATE_ANALYSIS.md +196 -0
- package/docs/MCP_INTERACTION_GUIDE.md +201 -0
- package/docs/MCP_SERVER_FOR_CURSOR.md +124 -0
- package/docs/PLAN.md +58 -0
- package/docs/PLAN_INDEPENDENT_LSP.md +145 -0
- package/docs/SKILL_DESIGN_PATTERNS.md +305 -0
- package/docs/TOOLS.md +317 -0
- package/lsp/README.md +41 -0
- package/lsp/node_modules/.bin/sysml-mcp +12 -0
- package/lsp/node_modules/.bin/sysml-mcp.cmd +9 -0
- package/lsp/node_modules/.bin/sysml-mcp.ps1 +16 -0
- package/lsp/node_modules/.package-lock.json +22 -0
- package/lsp/node_modules/sysml-v2-lsp/CHANGELOG.md +188 -0
- package/lsp/node_modules/sysml-v2-lsp/LICENSE +21 -0
- package/lsp/node_modules/sysml-v2-lsp/README.md +172 -0
- package/lsp/node_modules/sysml-v2-lsp/dist/server/mcpServer.js +167 -0
- package/lsp/node_modules/sysml-v2-lsp/dist/server/server.js +142 -0
- package/lsp/node_modules/sysml-v2-lsp/index.cjs +23 -0
- package/lsp/node_modules/sysml-v2-lsp/package.json +131 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/.project +17 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/.settings/org.eclipse.jdt.core.prefs +11 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Analysis/.meta.json +10 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Analysis/.project.json +27 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Analysis/AnalysisTooling.sysml +34 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Analysis/SampledFunctions.sysml +119 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Analysis/StateSpaceRepresentation.sysml +143 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Analysis/TradeStudies.sysml +171 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Cause and Effect/.meta.json +8 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Cause and Effect/.project.json +23 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Cause and Effect/CausationConnections.sysml +83 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Cause and Effect/CauseAndEffect.sysml +81 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Geometry/.meta.json +8 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Geometry/.project.json +27 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Geometry/ShapeItems.sysml +899 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Geometry/SpatialItems.sysml +168 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Metadata/.meta.json +10 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Metadata/.project.json +19 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Metadata/ImageMetadata.sysml +78 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Metadata/ModelingMetadata.sysml +143 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Metadata/ParametersOfInterestMetadata.sysml +39 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Metadata/RiskMetadata.sysml +100 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/.meta.json +29 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/.project.json +23 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQ.sysml +42 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQAcoustics.sysml +439 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQAtomicNuclear.sysml +2726 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQBase.sysml +206 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQCharacteristicNumbers.sysml +1991 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQChemistryMolecular.sysml +1353 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQCondensedMatter.sysml +1223 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQElectromagnetism.sysml +2333 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQInformation.sysml +958 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQLight.sysml +1537 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQMechanics.sysml +1564 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQSpaceTime.sysml +1169 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQThermodynamics.sysml +1256 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/MeasurementRefCalculations.sysml +30 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/MeasurementReferences.sysml +526 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/Quantities.sysml +107 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/QuantityCalculations.sysml +70 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/SI.sysml +378 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/SIPrefixes.sysml +48 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/TensorCalculations.sysml +50 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/Time.sysml +274 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/USCustomaryUnits.sysml +260 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/VectorCalculations.sysml +62 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Requirement Derivation/.meta.json +8 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Requirement Derivation/.project.json +19 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Requirement Derivation/DerivationConnections.sysml +63 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Requirement Derivation/RequirementDerivation.sysml +39 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Data Type Library/.meta.json +9 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Data Type Library/.project.json +11 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Data Type Library/Collections.kerml +147 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Data Type Library/ScalarValues.kerml +23 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Data Type Library/VectorValues.kerml +64 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/.meta.json +23 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/.project.json +15 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/BaseFunctions.kerml +80 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/BooleanFunctions.kerml +22 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/CollectionFunctions.kerml +68 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/ComplexFunctions.kerml +47 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/ControlFunctions.kerml +117 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/DataFunctions.kerml +43 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/IntegerFunctions.kerml +43 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/NaturalFunctions.kerml +27 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/NumericalFunctions.kerml +43 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/OccurrenceFunctions.kerml +154 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/RationalFunctions.kerml +49 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/RealFunctions.kerml +56 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/ScalarFunctions.kerml +33 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/SequenceFunctions.kerml +111 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/StringFunctions.kerml +25 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/TrigFunctions.kerml +35 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/VectorFunctions.kerml +273 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/.meta.json +22 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/.project.json +15 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Base.kerml +95 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Clocks.kerml +156 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/ControlPerformances.kerml +135 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/FeatureReferencingPerformances.kerml +190 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/KerML.kerml +483 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Links.kerml +67 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Metaobjects.kerml +58 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Objects.kerml +212 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Observation.kerml +161 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Occurrences.kerml +992 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Performances.kerml +293 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/SpatialFrames.kerml +197 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/StatePerformances.kerml +145 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Transfers.kerml +281 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/TransitionPerformances.kerml +66 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Triggers.kerml +188 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/.meta.json +27 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/.project.json +19 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Actions.sysml +552 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Allocations.sysml +29 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/AnalysisCases.sysml +38 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Attributes.sysml +25 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Calculations.sysml +37 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Cases.sysml +71 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Connections.sysml +60 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Constraints.sysml +44 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Flows.sysml +126 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Interfaces.sysml +89 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Items.sysml +153 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Metadata.sysml +32 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Parts.sysml +81 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Ports.sysml +54 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Requirements.sysml +194 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/StandardViewDefinitions.sysml +123 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/States.sysml +103 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/SysML.sysml +539 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/UseCases.sysml +57 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/VerificationCases.sysml +103 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Views.sysml +164 -0
- package/lsp/package-lock.json +30 -0
- package/lsp/package.json +15 -0
- package/lsp/test-server.mjs +120 -0
- package/package.json +61 -0
- package/scripts/access-sysml-mcp.mjs +45 -0
- package/scripts/check-sysml-v2-lsp-version.mjs +39 -0
- package/scripts/clean.mjs +14 -0
- package/scripts/compare-mcp-vs-lsp-symbols.mjs +76 -0
- package/scripts/debug-index.mjs +23 -0
- package/scripts/debug-lsp-symbols.mjs +62 -0
- package/scripts/deploy-skills.mjs +43 -0
- package/scripts/example-sysml-mcp.mjs +27 -0
- package/scripts/export-graph.mjs +80 -0
- package/scripts/generate-map.mjs +110 -0
- package/scripts/index-and-map.mjs +43 -0
- package/scripts/index-and-query.mjs +39 -0
- package/scripts/query-one.mjs +34 -0
- package/scripts/setup-lsp.mjs +36 -0
- package/scripts/test-lsp.mjs +55 -0
- package/scripts/test-mcp-debug.mjs +32 -0
- package/scripts/test-mcp-sysml.mjs +75 -0
- package/scripts/test-mcp-tools.mjs +185 -0
- package/scripts/test-sysml-mcp-from-node_modules.mjs +56 -0
- package/scripts/validate-sysml-file.mjs +69 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# Plan: Independent LSP Server in This Repo
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
|
|
5
|
+
Sysmledgraph is an **MCP server for Cursor** (query, context, impact, indexDbGraph, generate_map). When indexing runs (CLI or MCP tool), it spawns an **LSP subprocess** (sysml-v2-lsp `server.js`) to get document symbols. That LSP allows **only one client**; we must use a **dedicated instance** in **`lsp/`** so it is only for sysmledgraph—never shared with Cursor’s sysml-v2-lsp MCP server.
|
|
6
|
+
|
|
7
|
+
**Goal:** The LSP used by sysmledgraph always lives in this repo (**`lsp/`**), is installed by a defined step, and is used by default everywhere (CLI, MCP, scripts) without setting `SYSMLLSP_SERVER_PATH`.
|
|
8
|
+
|
|
9
|
+
**LSP source:** The only source of the LSP is the npm package [**sysml-v2-lsp**](https://www.npmjs.com/package/sysml-v2-lsp). We install it in **`lsp/`** (and optionally at root as fallback); there are no other builds or forks. The server entrypoints are `dist/server/server.js` (LSP) and `dist/server/mcpServer.js` (MCP) from that package.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Architecture
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
Cursor
|
|
17
|
+
├── sysmledgraph (MCP server) ← our server; tools: indexDbGraph, query, context, …
|
|
18
|
+
│ └── spawns LSP (server.js) from lsp/ ← only for indexing; single client
|
|
19
|
+
└── sysml-v2 (MCP server) ← optional; parse, validate, getSymbols; separate process
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
- **One MCP server (sysmledgraph)** for Cursor; **one LSP process (from `lsp/`)** used only by sysmledgraph (and CLI) for indexing.
|
|
23
|
+
- The LSP in **`lsp/`** is **only for sysmledgraph**. No sharing with Cursor’s sysml-v2 MCP.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Current state
|
|
28
|
+
|
|
29
|
+
| Area | Behaviour |
|
|
30
|
+
|------|-----------|
|
|
31
|
+
| **`lsp/`** | Exists; own `package.json` with `sysml-v2-lsp`; `npm start` / `npm run mcp`; README describes cwd and paths. |
|
|
32
|
+
| **Default path** | Only **`scripts/index-and-map.mjs`** sets env to `lsp/.../server.js` when unset. |
|
|
33
|
+
| **Elsewhere** | CLI analyze, MCP indexDbGraph, debug/compare scripts only read **`SYSMLLSP_SERVER_PATH`**. If unset → MCP fallback only (or script failure). |
|
|
34
|
+
|
|
35
|
+
So the LSP *can* live in `lsp/`, but we do not **default** to it from all entry points or **ensure** it is installed.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Requirements (what “independent” means)
|
|
40
|
+
|
|
41
|
+
1. **Single default path** — All code that needs the LSP uses: env → `lsp/node_modules/sysml-v2-lsp/dist/server/server.js` → root `node_modules/.../server.js`. No env required when `lsp/` is present.
|
|
42
|
+
2. **Guaranteed install** — After setup, `lsp/node_modules/sysml-v2-lsp/dist/server/server.js` exists (via setup script and/or postinstall).
|
|
43
|
+
3. **Optional later** — Root drops `sysml-v2-lsp` so only `lsp/` has it (single source of truth).
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Codebase modification requirements
|
|
48
|
+
|
|
49
|
+
| # | File / location | Change |
|
|
50
|
+
|---|-----------------|--------|
|
|
51
|
+
| 1 | **`src/parser/lsp-server-path.ts`** (new) | Add module exporting `getDefaultLspServerPath(): string or null`. Resolution: env → `lsp/node_modules/sysml-v2-lsp/dist/server/server.js` → `node_modules/sysml-v2-lsp/dist/server/server.js` (use `fs.existsSync`). |
|
|
52
|
+
| 2 | **`src/parser/lsp-client.ts`** | Replace (or wire) `resolveLspServerPath()` to use `getDefaultLspServerPath()` from the new module. Keep spawn cwd logic for paths under `lsp/node_modules/...`. |
|
|
53
|
+
| 3 | **`scripts/debug-lsp-symbols.mjs`** | When `SYSMLLSP_SERVER_PATH` is unset, set it to lsp path then root path (same order as Step 1). |
|
|
54
|
+
| 4 | **`scripts/compare-mcp-vs-lsp-symbols.mjs`** | Same as #3: default to lsp/ then root when env unset. |
|
|
55
|
+
| 5 | **`scripts/setup-lsp.mjs`** (new) | If `lsp/node_modules/sysml-v2-lsp/dist/server/server.js` exists → exit 0; else run `npm install` in `lsp/` (optionally `--ignore-scripts`). |
|
|
56
|
+
| 6 | **`package.json`** (root) | Add script: `"setup-lsp": "node scripts/setup-lsp.mjs"`. |
|
|
57
|
+
| 7 | **README** (or INSTALL) | Add: canonical LSP is in `lsp/`; run `npm run setup-lsp` or `cd lsp && npm install`; no need to set `SYSMLLSP_SERVER_PATH` for default. |
|
|
58
|
+
| 8 | **`lsp/README.md`** | Add: this is the only LSP used by sysmledgraph when present; root `node_modules` is fallback. |
|
|
59
|
+
| 9 | **`docs/MCP_SERVER_FOR_CURSOR.md`**, **`docs/MCP_INTERACTION_GUIDE.md`** | Mention: LSP is in `lsp/` and is picked automatically after setup. |
|
|
60
|
+
| 10 (optional) | **`package.json`** (root) | Remove `sysml-v2-lsp` from devDependencies; update any root code that imports it (e.g. validate script) to use `lsp/` or spawn from `lsp/`. |
|
|
61
|
+
|
|
62
|
+
**Notes:** Steps 1–2 are code; 3–4 are scripts (can call into built helper or duplicate two-path check); 5–6 are setup; 7–9 are docs; 10 is optional cleanup.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Steps
|
|
67
|
+
|
|
68
|
+
### Step 1: Default LSP path in code
|
|
69
|
+
|
|
70
|
+
**Add:** Module (e.g. **`src/parser/lsp-server-path.ts`**) exporting **`getDefaultLspServerPath(): string | null`**:
|
|
71
|
+
|
|
72
|
+
- If `SYSMLLSP_SERVER_PATH` is set and non-empty → resolve (absolute or cwd-relative) and return.
|
|
73
|
+
- Else, in order:
|
|
74
|
+
1. `resolve(cwd, 'lsp/node_modules/sysml-v2-lsp/dist/server/server.js')`
|
|
75
|
+
2. `resolve(cwd, 'node_modules/sysml-v2-lsp/dist/server/server.js')`
|
|
76
|
+
Return first path where `fs.existsSync(path)` is true, else `null`.
|
|
77
|
+
|
|
78
|
+
**Use in:** **`src/parser/lsp-client.ts`** — make **`resolveLspServerPath()`** call this helper. Keep existing spawn **cwd** logic (use `lsp/` when path is under `lsp/node_modules/...`).
|
|
79
|
+
|
|
80
|
+
**Verify:** Run `node scripts/debug-lsp-symbols.mjs test/fixtures/sysml/sample.sysml` with **no** `SYSMLLSP_SERVER_PATH`; with `lsp/` installed, it should use `lsp/.../server.js` and return symbols.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
### Step 2: Scripts use same default
|
|
85
|
+
|
|
86
|
+
**Update:** **`scripts/debug-lsp-symbols.mjs`** and **`scripts/compare-mcp-vs-lsp-symbols.mjs`** so that when `SYSMLLSP_SERVER_PATH` is unset they set it to the same order (lsp/ then root), e.g. by requiring the same helper or duplicating the two-path check.
|
|
87
|
+
|
|
88
|
+
**Note:** **`scripts/index-and-map.mjs`** already sets env; can stay as-is or switch to the shared helper later.
|
|
89
|
+
|
|
90
|
+
**Verify:** Same as Step 1; scripts behave like CLI/MCP.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
### Step 3: Ensure `lsp/` is installed (Option C — setup script)
|
|
95
|
+
|
|
96
|
+
**Use Option C.** Add **`scripts/setup-lsp.mjs`** and root script **`npm run setup-lsp`**:
|
|
97
|
+
|
|
98
|
+
- If `lsp/node_modules/sysml-v2-lsp/dist/server/server.js` exists → exit 0.
|
|
99
|
+
- Else run `npm install` in `lsp/` (use `--ignore-scripts` for Windows if needed).
|
|
100
|
+
- Document: “Run `npm run setup-lsp` or `cd lsp && npm install` to install the LSP used by sysmledgraph.”
|
|
101
|
+
|
|
102
|
+
No root postinstall or workspaces; the LSP is installed only when the user runs `setup-lsp` (or `cd lsp && npm install`).
|
|
103
|
+
|
|
104
|
+
**Verify:** After `npm run setup-lsp`, `lsp/node_modules/sysml-v2-lsp/dist/server/server.js` exists; index-and-map and CLI analyze use it without env.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
### Step 4: Documentation
|
|
109
|
+
|
|
110
|
+
- **README / INSTALL:** “Canonical LSP for this repo is in **`lsp/`**. Run `npm run setup-lsp` (or `cd lsp && npm install`). No need to set `SYSMLLSP_SERVER_PATH` when using the default.”
|
|
111
|
+
- **`lsp/README.md`:** “This is the **only** LSP used by sysmledgraph when present; root `node_modules` is fallback.”
|
|
112
|
+
- **docs/MCP_SERVER_FOR_CURSOR.md**, **docs/MCP_INTERACTION_GUIDE.md:** When running from this repo, LSP is in `lsp/` and is picked automatically after `setup-lsp` (or equivalent).
|
|
113
|
+
|
|
114
|
+
**Verify:** New contributors can follow README and get indexing working without setting env.
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
### Step 5 (optional): Root no longer depends on sysml-v2-lsp
|
|
119
|
+
|
|
120
|
+
- Remove **sysml-v2-lsp** from root **devDependencies**; only **`lsp/`** has it.
|
|
121
|
+
- **Caveat:** Root code that imports sysml-v2-lsp (e.g. validate script / MCP client) must be updated (resolve from `lsp/` or spawn MCP server from `lsp/`). Defer until Step 1–4 are done and dependencies are clear.
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Success criteria
|
|
126
|
+
|
|
127
|
+
- [ ] **Default path:** With `lsp/` installed and `SYSMLLSP_SERVER_PATH` unset, CLI analyze and MCP indexDbGraph use `lsp/node_modules/.../server.js`.
|
|
128
|
+
- [ ] **Scripts:** debug-lsp-symbols and compare-mcp-vs-lsp use the same default.
|
|
129
|
+
- [ ] **Install:** `npm run setup-lsp` (or documented equivalent) installs the LSP in `lsp/`.
|
|
130
|
+
- [ ] **Docs:** README and lsp/README state that the LSP is in `lsp/` and is only for sysmledgraph; MCP docs mention automatic use when setup is run.
|
|
131
|
+
- [ ] **No conflict:** Cursor can run both sysmledgraph MCP and sysml-v2 MCP; sysmledgraph’s indexing uses only the LSP in `lsp/`.
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Summary table
|
|
136
|
+
|
|
137
|
+
| Step | Action | Verification |
|
|
138
|
+
|------|--------|--------------|
|
|
139
|
+
| 1 | Default LSP path helper; use in lsp-client | debug-lsp-symbols works without env when lsp/ present |
|
|
140
|
+
| 2 | Scripts use same default (lsp/ then root) | All scripts consistent with CLI/MCP |
|
|
141
|
+
| 3 | setup-lsp script — Option C; document | LSP exists in lsp/ after setup; index works without env |
|
|
142
|
+
| 4 | README, lsp/README, MCP docs | Clear “LSP in lsp/, only for sysmledgraph” |
|
|
143
|
+
| 5 (opt) | Remove sysml-v2-lsp from root | Single copy in lsp/; validate/MCP client updated if needed |
|
|
144
|
+
|
|
145
|
+
**Outcome:** An LSP server lives only in **`lsp/`**, is installed via a defined step, and is used by default by CLI, MCP, and scripts. That LSP is **only for sysmledgraph**; Cursor keeps its own sysml-v2 MCP. No sharing, no single-client conflicts.
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
# Agent skill design patterns
|
|
2
|
+
|
|
3
|
+
**Summary:** The SKILL.md format (YAML, layout, spec) is standardized across 30+ agent tools. The real challenge is **content design**—how to structure the logic inside a skill. This doc captures five recurring patterns (from ecosystem practice: Anthropic, Vercel, Google, ADK) so we choose the right structure and compose skills reliably.
|
|
4
|
+
|
|
5
|
+
**When to use:** When creating or refactoring an agent *skill* (e.g. a `SKILL.md` file) in your repo, regardless of the specific agent runtime. This is about **content design** inside the skill, not about YAML/formatting.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Tool Wrapper
|
|
10
|
+
|
|
11
|
+
**Purpose:** Give the agent on-demand context for a **specific library or API**. Conventions live in the skill (or in `references/`); the agent loads them only when working with that technology.
|
|
12
|
+
|
|
13
|
+
**Mechanism:** Listen for library/keyword in the user prompt → load internal docs (e.g. `references/conventions.md`) → apply as authority when reviewing or writing code.
|
|
14
|
+
|
|
15
|
+
**Fits:** API experts (FastAPI, SysML v2), framework best practices, team coding guidelines.
|
|
16
|
+
|
|
17
|
+
**Example (generic):** A skill that wraps the conventions for a specific library/API. It loads the conventions only when the user's request is actually about that library/API.
|
|
18
|
+
|
|
19
|
+
**Full example (Tool Wrapper):**
|
|
20
|
+
|
|
21
|
+
```markdown
|
|
22
|
+
# skills/api-expert/SKILL.md
|
|
23
|
+
---
|
|
24
|
+
name: api-expert
|
|
25
|
+
description: FastAPI development best practices and conventions. Use when building, reviewing, or debugging FastAPI applications, REST APIs, or Pydantic models.
|
|
26
|
+
metadata:
|
|
27
|
+
pattern: tool-wrapper
|
|
28
|
+
domain: fastapi
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
You are an expert in FastAPI development. Apply these conventions to the user's code or question.
|
|
32
|
+
|
|
33
|
+
## Core Conventions
|
|
34
|
+
|
|
35
|
+
Load 'references/conventions.md' for the complete list of FastAPI best practices.
|
|
36
|
+
|
|
37
|
+
## When Reviewing Code
|
|
38
|
+
1. Load the conventions reference
|
|
39
|
+
2. Check the user's code against each convention
|
|
40
|
+
3. For each violation, cite the specific rule and suggest the fix
|
|
41
|
+
|
|
42
|
+
## When Writing Code
|
|
43
|
+
1. Load the conventions reference
|
|
44
|
+
2. Follow every convention exactly
|
|
45
|
+
3. Add type annotations to all function signatures
|
|
46
|
+
4. Use Annotated style for dependency injection
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
The actual rules live in `references/conventions.md`; the skill only says when to load them and how to apply them.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## 2. Generator
|
|
54
|
+
|
|
55
|
+
**Purpose:** Enforce **consistent output** from a fill-in-the-blank process. Avoids the agent inventing a new document structure every run.
|
|
56
|
+
|
|
57
|
+
**Mechanism:** `assets/` = output template; `references/` = style guide. Instructions: load template + style → ask user for missing variables → fill template → return single artifact.
|
|
58
|
+
|
|
59
|
+
**Fits:** Technical reports, API docs, commit messages, project scaffolds, standardized .md from a template.
|
|
60
|
+
|
|
61
|
+
**Example (generic):** Generating a standardized report or plan from a reusable template (so the output structure stays consistent across runs).
|
|
62
|
+
|
|
63
|
+
**Full example (Generator):**
|
|
64
|
+
|
|
65
|
+
```markdown
|
|
66
|
+
# skills/report-generator/SKILL.md
|
|
67
|
+
---
|
|
68
|
+
name: report-generator
|
|
69
|
+
description: Generates structured technical reports in Markdown. Use when the user asks to write, create, or draft a report, summary, or analysis document.
|
|
70
|
+
metadata:
|
|
71
|
+
pattern: generator
|
|
72
|
+
output-format: markdown
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
You are a technical report generator. Follow these steps exactly:
|
|
76
|
+
|
|
77
|
+
Step 1: Load 'references/style-guide.md' for tone and formatting rules.
|
|
78
|
+
|
|
79
|
+
Step 2: Load 'assets/report-template.md' for the required output structure.
|
|
80
|
+
|
|
81
|
+
Step 3: Ask the user for any missing information needed to fill the template:
|
|
82
|
+
- Topic or subject
|
|
83
|
+
- Key findings or data points
|
|
84
|
+
- Target audience (technical, executive, general)
|
|
85
|
+
|
|
86
|
+
Step 4: Fill the template following the style guide rules. Every section in the template must be present in the output.
|
|
87
|
+
|
|
88
|
+
Step 5: Return the completed report as a single Markdown document.
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Structure lives in `assets/report-template.md`, style in `references/style-guide.md`; the skill orchestrates load → gather vars → fill → return.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## 3. Reviewer
|
|
96
|
+
|
|
97
|
+
**Purpose:** Separate **what to check** from **how to check**. Rubric lives in `references/review-checklist.md`; the skill defines the protocol (load checklist → score by severity → structured output).
|
|
98
|
+
|
|
99
|
+
**Mechanism:** Load modular checklist → apply each rule → classify findings (error / warning / info) → produce summary, findings, score, top recommendations.
|
|
100
|
+
|
|
101
|
+
**Fits:** Code review, security audit (e.g. OWASP), style/spec compliance. Swap the checklist to get a different audit with the same skill shape.
|
|
102
|
+
|
|
103
|
+
**Example (generic):** Adding a Reviewer skill that scores a submission against a checklist (coding standards, security rules, or spec compliance).
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
**Full example (Reviewer):**
|
|
108
|
+
|
|
109
|
+
```markdown
|
|
110
|
+
# skills/code-reviewer/SKILL.md
|
|
111
|
+
---
|
|
112
|
+
name: code-reviewer
|
|
113
|
+
description: Reviews Python code for quality, style, and common bugs. Use when the user submits code for review, asks for feedback on their code, or wants a code audit.
|
|
114
|
+
metadata:
|
|
115
|
+
pattern: reviewer
|
|
116
|
+
severity-levels: error,warning,info
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
You are a Python code reviewer. Follow this review protocol exactly:
|
|
120
|
+
|
|
121
|
+
Step 1: Load 'references/review-checklist.md' for the complete review criteria.
|
|
122
|
+
|
|
123
|
+
Step 2: Read the user's code carefully. Understand its purpose before critiquing.
|
|
124
|
+
|
|
125
|
+
Step 3: Apply each rule from the checklist to the code. For every violation found:
|
|
126
|
+
- Note the line number (or approximate location)
|
|
127
|
+
- Classify severity: error (must fix), warning (should fix), info (consider)
|
|
128
|
+
- Explain WHY it's a problem, not just WHAT is wrong
|
|
129
|
+
- Suggest a specific fix with corrected code
|
|
130
|
+
|
|
131
|
+
Step 4: Produce a structured review with these sections:
|
|
132
|
+
- **Summary**: What the code does, overall quality assessment
|
|
133
|
+
- **Findings**: Grouped by severity (errors first, then warnings, then info)
|
|
134
|
+
- **Score**: Rate 1-10 with brief justification
|
|
135
|
+
- **Top 3 Recommendations**: The most impactful improvements
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Criteria live in `references/review-checklist.md`; swap that file (e.g. OWASP checklist) to get a different audit with the same skill.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## 4. Inversion
|
|
143
|
+
|
|
144
|
+
**Purpose:** **Agent interviews the user first**; no building or synthesizing until requirements are gathered. Flips the default "guess and generate" behavior.
|
|
145
|
+
|
|
146
|
+
**Mechanism:** Explicit gating: "DO NOT start building until all phases are complete." Phases = structured questions (one at a time, wait for answers). Only after all answers → load template and synthesize.
|
|
147
|
+
|
|
148
|
+
**Fits:** Project planning, system design kickoff, any task where wrong assumptions are costly.
|
|
149
|
+
|
|
150
|
+
**Example (generic):** A planning/refactor workflow that asks questions first and refuses to synthesize until requirements are confirmed.
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
**Full example (Inversion):**
|
|
155
|
+
|
|
156
|
+
```markdown
|
|
157
|
+
# skills/project-planner/SKILL.md
|
|
158
|
+
---
|
|
159
|
+
name: project-planner
|
|
160
|
+
description: Plans a new software project by gathering requirements through structured questions before producing a plan. Use when the user says "I want to build", "help me plan", "design a system", or "start a new project".
|
|
161
|
+
metadata:
|
|
162
|
+
pattern: inversion
|
|
163
|
+
interaction: multi-turn
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
You are conducting a structured requirements interview. DO NOT start building or designing until all phases are complete.
|
|
167
|
+
|
|
168
|
+
## Phase 1 — Problem Discovery (ask one question at a time, wait for each answer)
|
|
169
|
+
|
|
170
|
+
Ask these questions in order. Do not skip any.
|
|
171
|
+
|
|
172
|
+
- Q1: "What problem does this project solve for its users?"
|
|
173
|
+
- Q2: "Who are the primary users? What is their technical level?"
|
|
174
|
+
- Q3: "What is the expected scale? (users per day, data volume, request rate)"
|
|
175
|
+
|
|
176
|
+
## Phase 2 — Technical Constraints (only after Phase 1 is fully answered)
|
|
177
|
+
|
|
178
|
+
- Q4: "What deployment environment will you use?"
|
|
179
|
+
- Q5: "Do you have any technology stack requirements or preferences?"
|
|
180
|
+
- Q6: "What are the non-negotiable requirements? (latency, uptime, compliance, budget)"
|
|
181
|
+
|
|
182
|
+
## Phase 3 — Synthesis (only after all questions are answered)
|
|
183
|
+
|
|
184
|
+
1. Load 'assets/plan-template.md' for the output format
|
|
185
|
+
2. Fill in every section of the template using the gathered requirements
|
|
186
|
+
3. Present the completed plan to the user
|
|
187
|
+
4. Ask: "Does this plan accurately capture your requirements? What would you change?"
|
|
188
|
+
5. Iterate on feedback until the user confirms
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
The gate ("DO NOT start building until all phases are complete") and phased Q&A enforce gathering before synthesis; output format lives in `assets/plan-template.md`.
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## 5. Pipeline
|
|
196
|
+
|
|
197
|
+
**Purpose:** **Strict multi-step workflow with checkpoints.** No skipping steps; optional gates (e.g. user approval) between steps.
|
|
198
|
+
|
|
199
|
+
**Mechanism:** Instructions = workflow definition. Each step loads only the references/assets it needs. Diamond gates (e.g. "Do NOT proceed to Step 3 until the user confirms") prevent unvalidated results.
|
|
200
|
+
|
|
201
|
+
**Fits:** Doc generation pipelines (parse → docstrings → assemble → quality check), multi-step codegen, release checklists.
|
|
202
|
+
|
|
203
|
+
**Example (generic):** A multi-step "plan → implement → verify → lessons" workflow where each step is enforced in order.
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
**Full example (Pipeline):**
|
|
208
|
+
|
|
209
|
+
```markdown
|
|
210
|
+
# skills/doc-pipeline/SKILL.md
|
|
211
|
+
---
|
|
212
|
+
name: doc-pipeline
|
|
213
|
+
description: Generates API documentation from Python source code through a multi-step pipeline. Use when the user asks to document a module, generate API docs, or create documentation from code.
|
|
214
|
+
metadata:
|
|
215
|
+
pattern: pipeline
|
|
216
|
+
steps: "4"
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
You are running a documentation generation pipeline. Execute each step in order. Do NOT skip steps or proceed if a step fails.
|
|
220
|
+
|
|
221
|
+
## Step 1 — Parse & Inventory
|
|
222
|
+
Analyze the user's Python code to extract all public classes, functions, and constants. Present the inventory as a checklist. Ask: "Is this the complete public API you want documented?"
|
|
223
|
+
|
|
224
|
+
## Step 2 — Generate Docstrings
|
|
225
|
+
For each function lacking a docstring:
|
|
226
|
+
- Load 'references/docstring-style.md' for the required format
|
|
227
|
+
- Generate a docstring following the style guide exactly
|
|
228
|
+
- Present each generated docstring for user approval
|
|
229
|
+
Do NOT proceed to Step 3 until the user confirms.
|
|
230
|
+
|
|
231
|
+
## Step 3 — Assemble Documentation
|
|
232
|
+
Load 'assets/api-doc-template.md' for the output structure. Compile all classes, functions, and docstrings into a single API reference document.
|
|
233
|
+
|
|
234
|
+
## Step 4 — Quality Check
|
|
235
|
+
Review against 'references/quality-checklist.md':
|
|
236
|
+
- Every public symbol documented
|
|
237
|
+
- Every parameter has a type and description
|
|
238
|
+
- At least one usage example per function
|
|
239
|
+
Report results. Fix issues before presenting the final document.
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Steps are sequential with an explicit gate (no Step 3 until user confirms docstrings); each step loads only the refs/assets it needs; Step 4 is a Reviewer-style quality check inside the pipeline.
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## Choosing the right pattern
|
|
247
|
+
|
|
248
|
+
| Question | Pattern |
|
|
249
|
+
|----------|---------|
|
|
250
|
+
| "Agent should be an expert on library X when the user touches X" | **Tool Wrapper** |
|
|
251
|
+
| "Agent must produce the same document structure every time" | **Generator** |
|
|
252
|
+
| "Agent must score/critique against a checklist" | **Reviewer** |
|
|
253
|
+
| "Agent must ask questions before doing anything" | **Inversion** |
|
|
254
|
+
| "Agent must follow fixed steps and not skip or merge them" | **Pipeline** |
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## How to apply
|
|
259
|
+
|
|
260
|
+
### For a new skill
|
|
261
|
+
|
|
262
|
+
1. **Pick the pattern** using the table above (and Composition if the skill mixes patterns).
|
|
263
|
+
2. **Create the skill folder** (e.g. `skills/<name>/` or your framework's equivalent).
|
|
264
|
+
3. **Add frontmatter** including `metadata.pattern` (e.g. `tool-wrapper`, `generator`, `reviewer`, `inversion`, `pipeline`).
|
|
265
|
+
4. **Write the body to match the pattern:**
|
|
266
|
+
- **Tool Wrapper:** "When … load `references/conventions.md` (or inline). When reviewing/writing: 1. Load ref 2. Apply rules."
|
|
267
|
+
- **Generator:** "Step 1: Load `references/style-guide.md`. Step 2: Load `assets/template.md`. Step 3: Ask user for missing vars. Step 4: Fill template. Step 5: Return output."
|
|
268
|
+
- **Reviewer:** "Step 1: Load `references/review-checklist.md`. Step 2: Apply each rule. Step 3: Classify by severity. Step 4: Output summary, findings, score."
|
|
269
|
+
- **Inversion:** "DO NOT build until all phases are complete. Phase 1: ask Q1, Q2, Q3 (one at a time). Phase 2: ask Q4, Q5, Q6. Phase 3: only then load template and synthesize."
|
|
270
|
+
- **Pipeline:** "Execute steps in order. Do NOT skip. Step 1: … Step 2: … [Gate: do not proceed until user confirms.] Step 3: …"
|
|
271
|
+
5. **Add optional dirs** if the skill references them: `references/` (conventions, checklists, style guides), `assets/` (templates).
|
|
272
|
+
|
|
273
|
+
### For an existing skill
|
|
274
|
+
|
|
275
|
+
1. **Decide which pattern it already is** (or which it's closest to).
|
|
276
|
+
2. **Add `metadata.pattern`** in the YAML frontmatter.
|
|
277
|
+
3. **Optionally refactor:** move long "what to check" or "conventions" into `references/<name>.md` and have the skill say "Load references/…"; move output structure into `assets/template.md` for Generators.
|
|
278
|
+
4. **If it mixes patterns,** tag the primary one and add one line (e.g. "Uses Inversion at start to gather variables, then Generator to fill template").
|
|
279
|
+
|
|
280
|
+
### Folder layout (optional)
|
|
281
|
+
|
|
282
|
+
```
|
|
283
|
+
skills/<skill-name>/
|
|
284
|
+
SKILL.md # Required: name, description, pattern, instructions
|
|
285
|
+
references/ # Optional: conventions.md, review-checklist.md, style-guide.md
|
|
286
|
+
assets/ # Optional: template.md, plan-template.md
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
If your tooling uses a different directory (e.g. Cursor's `.cursor/skills/`), substitute accordingly.
|
|
290
|
+
|
|
291
|
+
Not every skill needs `references/` or `assets/`; Tool Wrappers often keep conventions inline. Use them when the content is long or reused.
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## Composition
|
|
296
|
+
|
|
297
|
+
Patterns compose. A **Pipeline** can include a **Reviewer** step at the end. A **Generator** can use **Inversion** at the start to gather variables before filling the template. Tag skills with `metadata.pattern` (e.g. `tool-wrapper`, `generator`) so agents and humans can see the design at a glance.
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
## References
|
|
302
|
+
|
|
303
|
+
- Optional internal: your repo's skill index/table (e.g. `AGENTS.md`) and any "create-skill" rule/skill you keep locally.
|
|
304
|
+
- **Agent Development Kit (ADK):** [google.github.io/adk-docs](https://google.github.io/adk-docs/) — Google's framework for building and deploying AI agents (Python, TypeScript, Go, Java). Model-agnostic; supports workflow agents (sequential, loop, parallel), multi-agent systems, custom/MCP/OpenAPI tools, and **Skills**. ADK 2.0 adds graph-based workflows. The five skill patterns (Tool Wrapper, Generator, Reviewer, Inversion, Pipeline) are often implemented with ADK SkillToolset and progressive disclosure.
|
|
305
|
+
- External: Article on five agent skill patterns with ADK code examples—by Shubham Saboo and Lavini Gam; ecosystem study (Anthropic, Vercel, Google).
|