agent-lyra 0.7.0 → 0.10.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.
Files changed (126) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +301 -276
  3. package/bin/agent-lyra.js +51 -51
  4. package/bin/lyra-oss-preview.js +16 -16
  5. package/package.json +60 -60
  6. package/src/app-builder/export.js +109 -109
  7. package/src/app-builder/gateway.js +62 -62
  8. package/src/app-builder/init.js +115 -72
  9. package/src/app-builder/manifest-contract.js +46 -46
  10. package/src/app-builder/native-adapter.js +29 -29
  11. package/src/app-builder/preview.js +35 -31
  12. package/src/app-builder/publish.js +14 -14
  13. package/src/app-builder/saved-app.js +70 -70
  14. package/src/app-builder/saved-preview-browser.js +33 -33
  15. package/src/app-builder/saved-preview.html +24 -24
  16. package/src/app-builder/saved-preview.js +61 -61
  17. package/src/app-builder/support-manifest.js +50 -50
  18. package/src/app-builder/support-template/manifest.json +55 -55
  19. package/src/app-builder/support-template/support-preview.html +56 -56
  20. package/src/app-builder/support-template/support-preview.js +37 -37
  21. package/src/app-builder/support-template/support-preview.mjs +67 -67
  22. package/src/app-builder/support-template/support-workflow.mjs +36 -36
  23. package/src/app-builder/use.js +37 -37
  24. package/src/app-builder/validate.js +31 -21
  25. package/src/app-builder/value-schema.js +37 -37
  26. package/src/catalog.js +147 -147
  27. package/src/coding/catalog.js +56 -56
  28. package/src/coding/cloud-catalog.js +64 -64
  29. package/src/coding/detect-stack.mjs +110 -110
  30. package/src/coding/export.js +133 -133
  31. package/src/coding/setup.js +175 -175
  32. package/src/coding/skills/lyra-android/SKILL.md +37 -37
  33. package/src/coding/skills/lyra-angular/SKILL.md +37 -37
  34. package/src/coding/skills/lyra-cucumber/SKILL.md +37 -37
  35. package/src/coding/skills/lyra-dbt/SKILL.md +37 -37
  36. package/src/coding/skills/lyra-django/SKILL.md +37 -37
  37. package/src/coding/skills/lyra-docker/SKILL.md +37 -37
  38. package/src/coding/skills/lyra-dotnet/SKILL.md +37 -37
  39. package/src/coding/skills/lyra-express/SKILL.md +37 -37
  40. package/src/coding/skills/lyra-fastapi/SKILL.md +37 -37
  41. package/src/coding/skills/lyra-flutter/SKILL.md +37 -37
  42. package/src/coding/skills/lyra-github-actions/SKILL.md +37 -37
  43. package/src/coding/skills/lyra-gitlab-ci/SKILL.md +37 -37
  44. package/src/coding/skills/lyra-go/SKILL.md +37 -37
  45. package/src/coding/skills/lyra-ios/SKILL.md +37 -37
  46. package/src/coding/skills/lyra-kubernetes/SKILL.md +37 -37
  47. package/src/coding/skills/lyra-mongodb/SKILL.md +37 -37
  48. package/src/coding/skills/lyra-mysql/SKILL.md +37 -37
  49. package/src/coding/skills/lyra-nextjs/SKILL.md +37 -37
  50. package/src/coding/skills/lyra-node/SKILL.md +37 -37
  51. package/src/coding/skills/lyra-playwright/SKILL.md +37 -37
  52. package/src/coding/skills/lyra-postgresql/SKILL.md +37 -37
  53. package/src/coding/skills/lyra-python/SKILL.md +37 -37
  54. package/src/coding/skills/lyra-react/SKILL.md +37 -37
  55. package/src/coding/skills/lyra-react-native/SKILL.md +37 -37
  56. package/src/coding/skills/lyra-redis/SKILL.md +37 -37
  57. package/src/coding/skills/lyra-rust/SKILL.md +37 -37
  58. package/src/coding/skills/lyra-spark/SKILL.md +37 -37
  59. package/src/coding/skills/lyra-spring-boot/SKILL.md +37 -37
  60. package/src/coding/skills/lyra-svelte/SKILL.md +37 -37
  61. package/src/coding/skills/lyra-terraform/SKILL.md +37 -37
  62. package/src/coding/skills/lyra-typescript/SKILL.md +37 -37
  63. package/src/coding/skills/lyra-vue/SKILL.md +37 -37
  64. package/src/framework/agent.js +181 -173
  65. package/src/framework/mda.js +65 -0
  66. package/src/framework/run.py +111 -111
  67. package/src/gated/hostedAgents.js +56 -56
  68. package/src/gated/index.d.ts +25 -25
  69. package/src/gated/index.js +5 -5
  70. package/src/index.d.ts +2 -2
  71. package/src/index.js +2 -2
  72. package/src/init.js +960 -960
  73. package/src/intelligence/graphsnip-provider.d.ts +5 -5
  74. package/src/intelligence/graphsnip-provider.js +57 -57
  75. package/src/intelligence/lifecycle.js +25 -0
  76. package/src/memory/LICENSE +21 -21
  77. package/src/memory/README.md +5 -5
  78. package/src/memory/UPSTREAM.json +24 -14
  79. package/src/memory/bridge-cli.js +16 -16
  80. package/src/memory/bridge.js +18 -18
  81. package/src/memory/cli.js +21 -21
  82. package/src/memory/cloud-sync-actions.js +61 -61
  83. package/src/memory/contract.json +45 -45
  84. package/src/memory/index.d.ts +50 -49
  85. package/src/memory/index.js +7 -7
  86. package/src/memory/lifecycle.js +29 -29
  87. package/src/memory/local-cli.js +34 -34
  88. package/src/memory/local-store.js +209 -209
  89. package/src/memory/package.json +33 -33
  90. package/src/memory/proposals.js +90 -90
  91. package/src/memory/skills-cli.js +26 -26
  92. package/src/memory/standalone.d.ts +50 -50
  93. package/src/memory/standalone.js +1 -1
  94. package/src/memory/sync.js +89 -89
  95. package/src/memory/validation.js +25 -25
  96. package/src/onboardingAgents.js +532 -532
  97. package/src/promptTemplates.js +178 -178
  98. package/src/resource-files.js +18 -18
  99. package/src/runtime/contracts.d.ts +47 -47
  100. package/src/runtime/local-cli.js +161 -160
  101. package/src/runtime/mcp-stdio.js +111 -111
  102. package/src/runtime/orchestration.js +59 -59
  103. package/src/runtime/run-agent.js +54 -53
  104. package/src/standalone/index.d.ts +45 -45
  105. package/src/standalone/index.js +13 -13
  106. package/src/standalone/init.js +12 -12
  107. package/src/standalone/orchestration.js +6 -6
  108. package/src/standalone/rag.js +113 -113
  109. package/src/studio/agent-ui.css +43 -43
  110. package/src/studio/agent-ui.js +32 -32
  111. package/src/studio/browser.js +542 -345
  112. package/src/studio/export.js +83 -85
  113. package/src/studio/index.html +74 -37
  114. package/src/studio/memory-actions.js +37 -37
  115. package/src/studio/memory-panel.js +200 -200
  116. package/src/studio/project.js +308 -240
  117. package/src/studio/pull-agent.js +72 -72
  118. package/src/studio/push.js +54 -54
  119. package/src/studio/python-agent.js +47 -47
  120. package/src/studio/python-agent.py +25 -25
  121. package/src/studio/server.js +164 -150
  122. package/src/studio/session.js +83 -83
  123. package/src/studio/studio.css +257 -10
  124. package/src/studio/sync.js +42 -42
  125. package/src/studio/workflow-editor.js +240 -0
  126. package/src/studio/workflow-sync.js +229 -157
@@ -1,37 +1,37 @@
1
- ---
2
- name: lyra-dbt
3
- description: "Implement dbt models, tests, documentation, and incremental changes safely."
4
- ---
5
-
6
- # dbt
7
-
8
- ## Inspect the project
9
-
10
- Check the dbt adapter and version, model selectors, environments, macro conventions, and target warehouse. Trace source lineage and grain.
11
-
12
- ## Implementation practices
13
-
14
- - Use ref and source for declared dependencies. Define each model's grain, key, and expected null behavior and document resulting columns where relevant.
15
- - Choose materialization based on workload. For incremental models, account for late data, repeated inputs, schema changes, and backfill semantics.
16
- - Add focused uniqueness, not-null, relationship, or domain tests based on model invariants. Check freshness when delay affects consumers.
17
-
18
- ## Guardrails and trade-offs
19
-
20
- - Use development schemas and synthetic or approved datasets. Review credential scope and avoid running broad backfills or full refreshes by default.
21
- - Measure query cost and affected downstream models. Review compatibility for consumers and handle sensitive fields according to existing governance.
22
-
23
- ## Decisions to check
24
-
25
- Separate model unit behavior from warehouse-level data tests when the project's dbt version supports both. Review model contracts or exposures where downstream consumers depend on them. Estimate execution and warehouse cost before expanding selectors.
26
-
27
- ## Review scenario
28
-
29
- For an incremental model, verify an initial build, late-arriving data, duplicate input, and a rerun against the same data.
30
-
31
- ## Verification
32
-
33
- Compile and build the affected selector in a test target. Inspect test results, lineage, and representative row counts before rollout.
34
-
35
- ## Reference
36
-
37
- - [dbt documentation](https://docs.getdbt.com/docs/build/data-tests)
1
+ ---
2
+ name: lyra-dbt
3
+ description: "Implement dbt models, tests, documentation, and incremental changes safely."
4
+ ---
5
+
6
+ # dbt
7
+
8
+ ## Inspect the project
9
+
10
+ Check the dbt adapter and version, model selectors, environments, macro conventions, and target warehouse. Trace source lineage and grain.
11
+
12
+ ## Implementation practices
13
+
14
+ - Use ref and source for declared dependencies. Define each model's grain, key, and expected null behavior and document resulting columns where relevant.
15
+ - Choose materialization based on workload. For incremental models, account for late data, repeated inputs, schema changes, and backfill semantics.
16
+ - Add focused uniqueness, not-null, relationship, or domain tests based on model invariants. Check freshness when delay affects consumers.
17
+
18
+ ## Guardrails and trade-offs
19
+
20
+ - Use development schemas and synthetic or approved datasets. Review credential scope and avoid running broad backfills or full refreshes by default.
21
+ - Measure query cost and affected downstream models. Review compatibility for consumers and handle sensitive fields according to existing governance.
22
+
23
+ ## Decisions to check
24
+
25
+ Separate model unit behavior from warehouse-level data tests when the project's dbt version supports both. Review model contracts or exposures where downstream consumers depend on them. Estimate execution and warehouse cost before expanding selectors.
26
+
27
+ ## Review scenario
28
+
29
+ For an incremental model, verify an initial build, late-arriving data, duplicate input, and a rerun against the same data.
30
+
31
+ ## Verification
32
+
33
+ Compile and build the affected selector in a test target. Inspect test results, lineage, and representative row counts before rollout.
34
+
35
+ ## Reference
36
+
37
+ - [dbt documentation](https://docs.getdbt.com/docs/build/data-tests)
@@ -1,37 +1,37 @@
1
- ---
2
- name: lyra-django
3
- description: "Implement Django models, migrations, views, forms, and permissions."
4
- ---
5
-
6
- # Django
7
-
8
- ## Inspect the project
9
-
10
- Read the Django release, app structure, settings modules, middleware, and ORM usage. Trace the URL, view, form or serializer, and database writes.
11
-
12
- ## Implementation practices
13
-
14
- - Use Django's validation and built-in CSRF protections for browser mutations. Scope querysets by authorization and enforce object-level checks on reads and writes.
15
- - Treat schema and data migrations as separate concerns where useful. Use historical models in migration code and keep changes compatible with the rollout order.
16
- - Manage atomicity deliberately and schedule external effects only after a successful commit where appropriate. Avoid repeated ORM queries with measured joins or prefetching.
17
-
18
- ## Guardrails and trade-offs
19
-
20
- - Keep autoescaping active and use explicit validation for user-controlled file access. Redact sensitive data from logs and keep debug settings out of production.
21
- - Preserve URL names, forms, permissions, status codes, and template context contracts that existing callers use.
22
-
23
- ## Decisions to check
24
-
25
- Review how queryset operations evaluate and where lazy relations can lead to repeated queries. Preserve intended authorization when adding custom model managers or bulk operations. Ensure permission tests cover authenticated users without access as well as anonymous users.
26
-
27
- ## Review scenario
28
-
29
- For an owner-only edit, verify owner access and another authenticated user's rejection. Include invalid form data and ensure no partial writes.
30
-
31
- ## Verification
32
-
33
- Run Django checks and targeted tests. Rehearse migrations and inspect query count or plans for performance-sensitive changes.
34
-
35
- ## Reference
36
-
37
- - [Django documentation](https://docs.djangoproject.com/en/stable/)
1
+ ---
2
+ name: lyra-django
3
+ description: "Implement Django models, migrations, views, forms, and permissions."
4
+ ---
5
+
6
+ # Django
7
+
8
+ ## Inspect the project
9
+
10
+ Read the Django release, app structure, settings modules, middleware, and ORM usage. Trace the URL, view, form or serializer, and database writes.
11
+
12
+ ## Implementation practices
13
+
14
+ - Use Django's validation and built-in CSRF protections for browser mutations. Scope querysets by authorization and enforce object-level checks on reads and writes.
15
+ - Treat schema and data migrations as separate concerns where useful. Use historical models in migration code and keep changes compatible with the rollout order.
16
+ - Manage atomicity deliberately and schedule external effects only after a successful commit where appropriate. Avoid repeated ORM queries with measured joins or prefetching.
17
+
18
+ ## Guardrails and trade-offs
19
+
20
+ - Keep autoescaping active and use explicit validation for user-controlled file access. Redact sensitive data from logs and keep debug settings out of production.
21
+ - Preserve URL names, forms, permissions, status codes, and template context contracts that existing callers use.
22
+
23
+ ## Decisions to check
24
+
25
+ Review how queryset operations evaluate and where lazy relations can lead to repeated queries. Preserve intended authorization when adding custom model managers or bulk operations. Ensure permission tests cover authenticated users without access as well as anonymous users.
26
+
27
+ ## Review scenario
28
+
29
+ For an owner-only edit, verify owner access and another authenticated user's rejection. Include invalid form data and ensure no partial writes.
30
+
31
+ ## Verification
32
+
33
+ Run Django checks and targeted tests. Rehearse migrations and inspect query count or plans for performance-sensitive changes.
34
+
35
+ ## Reference
36
+
37
+ - [Django documentation](https://docs.djangoproject.com/en/stable/)
@@ -1,37 +1,37 @@
1
- ---
2
- name: lyra-docker
3
- description: "Build and review Docker images, container startup, and Compose configuration."
4
- ---
5
-
6
- # Docker
7
-
8
- ## Inspect the project
9
-
10
- Identify the target OS and architecture, supported runtime, build context, and deployment expectations. Read existing Dockerfiles and ignore rules.
11
-
12
- ## Implementation practices
13
-
14
- - Use a trusted base image and a reproducible dependency install. Separate build and runtime stages where helpful and ship only runtime files.
15
- - Keep package caches and unrelated files out of the runtime image. Choose image versions or digests according to the project's update policy.
16
- - Keep secrets out of build arguments, layers, and copied files. Use the build or runtime secret mechanism and run with the minimum required privileges.
17
-
18
- ## Guardrails and trade-offs
19
-
20
- - Ensure executable permissions, signal delivery, startup dependencies, and health behavior match the deployment. Persist required state through the approved storage mechanism.
21
- - Measure image size and build timings when optimizing. Keep dependencies and cache boundaries aligned with the files that invalidate them.
22
-
23
- ## Decisions to check
24
-
25
- Check whether build args or context changes invalidate dependency layers. Review entrypoints for shell wrappers that swallow signals or exit codes. Validate the container when its root filesystem or build environment is more constrained than the local machine.
26
-
27
- ## Review scenario
28
-
29
- For an API container, confirm the process receives shutdown signals, stops accepting work, and drains outstanding requests within the orchestrator deadline.
30
-
31
- ## Verification
32
-
33
- Build and run the target image locally with synthetic configuration. Check health, startup failure, filesystem permissions, shutdown, and required architectures.
34
-
35
- ## Reference
36
-
37
- - [Docker documentation](https://docs.docker.com/build/building/best-practices/)
1
+ ---
2
+ name: lyra-docker
3
+ description: "Build and review Docker images, container startup, and Compose configuration."
4
+ ---
5
+
6
+ # Docker
7
+
8
+ ## Inspect the project
9
+
10
+ Identify the target OS and architecture, supported runtime, build context, and deployment expectations. Read existing Dockerfiles and ignore rules.
11
+
12
+ ## Implementation practices
13
+
14
+ - Use a trusted base image and a reproducible dependency install. Separate build and runtime stages where helpful and ship only runtime files.
15
+ - Keep package caches and unrelated files out of the runtime image. Choose image versions or digests according to the project's update policy.
16
+ - Keep secrets out of build arguments, layers, and copied files. Use the build or runtime secret mechanism and run with the minimum required privileges.
17
+
18
+ ## Guardrails and trade-offs
19
+
20
+ - Ensure executable permissions, signal delivery, startup dependencies, and health behavior match the deployment. Persist required state through the approved storage mechanism.
21
+ - Measure image size and build timings when optimizing. Keep dependencies and cache boundaries aligned with the files that invalidate them.
22
+
23
+ ## Decisions to check
24
+
25
+ Check whether build args or context changes invalidate dependency layers. Review entrypoints for shell wrappers that swallow signals or exit codes. Validate the container when its root filesystem or build environment is more constrained than the local machine.
26
+
27
+ ## Review scenario
28
+
29
+ For an API container, confirm the process receives shutdown signals, stops accepting work, and drains outstanding requests within the orchestrator deadline.
30
+
31
+ ## Verification
32
+
33
+ Build and run the target image locally with synthetic configuration. Check health, startup failure, filesystem permissions, shutdown, and required architectures.
34
+
35
+ ## Reference
36
+
37
+ - [Docker documentation](https://docs.docker.com/build/building/best-practices/)
@@ -1,37 +1,37 @@
1
- ---
2
- name: lyra-dotnet
3
- description: "Implement .NET services and APIs with compatible hosting, dependency injection, and data access."
4
- ---
5
-
6
- # .NET
7
-
8
- ## Inspect the project
9
-
10
- Check the target framework, SDK pin, hosting model, test projects, nullable settings, and installed framework features.
11
-
12
- ## Implementation practices
13
-
14
- - Model configuration with typed options and validate important settings at startup. Respect transient, scoped, and singleton lifetimes, especially for DbContext.
15
- - Propagate CancellationToken to supported operations. Keep server-side I/O asynchronous and bound resource use and retries.
16
- - Validate payloads and centralize error mapping. Enforce resource authorization independently of endpoint authentication and keep sensitive data out of Problem Details.
17
-
18
- ## Guardrails and trade-offs
19
-
20
- - Use EF Core transactions and projections intentionally. Review migration ordering, parameterization, and data-loading cost before changing queries.
21
- - Keep logging structured and redact credentials and private request data. Reuse application health and metrics conventions.
22
-
23
- ## Decisions to check
24
-
25
- Validate configuration in the effective hosted environment and use the project's forwarded-header policy behind proxies. Review middleware order when changing authentication, authorization, exception handling, or routing. Test behavior through the HTTP host when middleware forms part of the contract.
26
-
27
- ## Review scenario
28
-
29
- For a cancellation-sensitive endpoint, cancel a test request and verify downstream work observes cancellation and releases its resources.
30
-
31
- ## Verification
32
-
33
- Run dotnet build and the relevant tests through the project's solution or scripts. Verify integration tests against the actual hosting and data boundaries.
34
-
35
- ## Reference
36
-
37
- - [.NET documentation](https://learn.microsoft.com/en-us/aspnet/core/)
1
+ ---
2
+ name: lyra-dotnet
3
+ description: "Implement .NET services and APIs with compatible hosting, dependency injection, and data access."
4
+ ---
5
+
6
+ # .NET
7
+
8
+ ## Inspect the project
9
+
10
+ Check the target framework, SDK pin, hosting model, test projects, nullable settings, and installed framework features.
11
+
12
+ ## Implementation practices
13
+
14
+ - Model configuration with typed options and validate important settings at startup. Respect transient, scoped, and singleton lifetimes, especially for DbContext.
15
+ - Propagate CancellationToken to supported operations. Keep server-side I/O asynchronous and bound resource use and retries.
16
+ - Validate payloads and centralize error mapping. Enforce resource authorization independently of endpoint authentication and keep sensitive data out of Problem Details.
17
+
18
+ ## Guardrails and trade-offs
19
+
20
+ - Use EF Core transactions and projections intentionally. Review migration ordering, parameterization, and data-loading cost before changing queries.
21
+ - Keep logging structured and redact credentials and private request data. Reuse application health and metrics conventions.
22
+
23
+ ## Decisions to check
24
+
25
+ Validate configuration in the effective hosted environment and use the project's forwarded-header policy behind proxies. Review middleware order when changing authentication, authorization, exception handling, or routing. Test behavior through the HTTP host when middleware forms part of the contract.
26
+
27
+ ## Review scenario
28
+
29
+ For a cancellation-sensitive endpoint, cancel a test request and verify downstream work observes cancellation and releases its resources.
30
+
31
+ ## Verification
32
+
33
+ Run dotnet build and the relevant tests through the project's solution or scripts. Verify integration tests against the actual hosting and data boundaries.
34
+
35
+ ## Reference
36
+
37
+ - [.NET documentation](https://learn.microsoft.com/en-us/aspnet/core/)
@@ -1,37 +1,37 @@
1
- ---
2
- name: lyra-express
3
- description: "Implement Express routes, middleware, validation, error handling, and service checks."
4
- ---
5
-
6
- # Express
7
-
8
- ## Inspect the project
9
-
10
- Identify the Express major version, router mount path, middleware order, body parser, proxy topology, and error response contract.
11
-
12
- ## Implementation practices
13
-
14
- - Authenticate early and authorize against the resource and tenant on the server. Validate params, query, headers, and body. Put bounds on payload sizes and pagination.
15
- - Keep handlers thin by reusing service logic. Map known failures to stable status codes and return a consistent public response shape.
16
- - Route asynchronous errors through the project's error middleware according to its Express version. Preserve a single response per request and handle aborted streaming requests.
17
-
18
- ## Guardrails and trade-offs
19
-
20
- - Configure trust proxy for the actual topology. Treat CORS as a browser control and enforce access checks independently. Protect cookie-authenticated mutations using the project's CSRF controls.
21
- - Avoid exposing stack traces, secrets, raw request bodies, or internal database errors. Use request IDs and structured logs with safe fields.
22
-
23
- ## Decisions to check
24
-
25
- Keep the fallback 404 and terminal error middleware after route registration. Validate content type where needed and distinguish client input errors from upstream errors. Make write retries safe through an idempotency strategy where retries are expected.
26
-
27
- ## Review scenario
28
-
29
- For an update endpoint, verify that a valid user from a different tenant cannot mutate the resource and that invalid input fails before the store is called.
30
-
31
- ## Verification
32
-
33
- Run integration tests through the mounted router. Exercise valid, malformed, unauthenticated, forbidden, missing, conflict, and unexpected failure cases as relevant.
34
-
35
- ## Reference
36
-
37
- - [Express documentation](https://expressjs.com/en/advanced/best-practice-security.html)
1
+ ---
2
+ name: lyra-express
3
+ description: "Implement Express routes, middleware, validation, error handling, and service checks."
4
+ ---
5
+
6
+ # Express
7
+
8
+ ## Inspect the project
9
+
10
+ Identify the Express major version, router mount path, middleware order, body parser, proxy topology, and error response contract.
11
+
12
+ ## Implementation practices
13
+
14
+ - Authenticate early and authorize against the resource and tenant on the server. Validate params, query, headers, and body. Put bounds on payload sizes and pagination.
15
+ - Keep handlers thin by reusing service logic. Map known failures to stable status codes and return a consistent public response shape.
16
+ - Route asynchronous errors through the project's error middleware according to its Express version. Preserve a single response per request and handle aborted streaming requests.
17
+
18
+ ## Guardrails and trade-offs
19
+
20
+ - Configure trust proxy for the actual topology. Treat CORS as a browser control and enforce access checks independently. Protect cookie-authenticated mutations using the project's CSRF controls.
21
+ - Avoid exposing stack traces, secrets, raw request bodies, or internal database errors. Use request IDs and structured logs with safe fields.
22
+
23
+ ## Decisions to check
24
+
25
+ Keep the fallback 404 and terminal error middleware after route registration. Validate content type where needed and distinguish client input errors from upstream errors. Make write retries safe through an idempotency strategy where retries are expected.
26
+
27
+ ## Review scenario
28
+
29
+ For an update endpoint, verify that a valid user from a different tenant cannot mutate the resource and that invalid input fails before the store is called.
30
+
31
+ ## Verification
32
+
33
+ Run integration tests through the mounted router. Exercise valid, malformed, unauthenticated, forbidden, missing, conflict, and unexpected failure cases as relevant.
34
+
35
+ ## Reference
36
+
37
+ - [Express documentation](https://expressjs.com/en/advanced/best-practice-security.html)
@@ -1,37 +1,37 @@
1
- ---
2
- name: lyra-fastapi
3
- description: "Maintain FastAPI endpoints, Pydantic models, dependency wiring, and OpenAPI contracts."
4
- ---
5
-
6
- # FastAPI
7
-
8
- ## Inspect the project
9
-
10
- Inspect the FastAPI and Pydantic versions, router wiring, exception handlers, and lifespan configuration. Trace request data and permission dependencies.
11
-
12
- ## Implementation practices
13
-
14
- - Use request and response schemas to validate and shape the public contract. Distinguish optional from nullable fields and deliberately exclude private model fields.
15
- - Authorize each resource using the current identity and tenant. Reuse existing dependency injection and return consistent error responses.
16
- - Use async handlers with async clients. Handle blocking work through the team's established sync or worker path. Scope and release sessions and clients predictably.
17
-
18
- ## Guardrails and trade-offs
19
-
20
- - Set limits for uploads, pagination, and expensive queries. Keep raw exception text and credentials outside public responses and structured logs.
21
- - Treat status codes, response shapes, and generated OpenAPI as compatibility surfaces. Review client generation or event consumers before changing them.
22
-
23
- ## Decisions to check
24
-
25
- Model pagination and error responses explicitly when clients depend on them. Use dependency overrides only in tests and reset overrides between cases. Use the project job mechanism for durable work that must survive restarts.
26
-
27
- ## Review scenario
28
-
29
- For a partial update, test omitted fields separately from fields explicitly set to null. Verify response serialization excludes internal fields.
30
-
31
- ## Verification
32
-
33
- Run API tests with the project test client and override dependencies at the test boundary. Verify authorization failures, validation errors, response shape, and lifespan cleanup.
34
-
35
- ## Reference
36
-
37
- - [FastAPI documentation](https://fastapi.tiangolo.com/)
1
+ ---
2
+ name: lyra-fastapi
3
+ description: "Maintain FastAPI endpoints, Pydantic models, dependency wiring, and OpenAPI contracts."
4
+ ---
5
+
6
+ # FastAPI
7
+
8
+ ## Inspect the project
9
+
10
+ Inspect the FastAPI and Pydantic versions, router wiring, exception handlers, and lifespan configuration. Trace request data and permission dependencies.
11
+
12
+ ## Implementation practices
13
+
14
+ - Use request and response schemas to validate and shape the public contract. Distinguish optional from nullable fields and deliberately exclude private model fields.
15
+ - Authorize each resource using the current identity and tenant. Reuse existing dependency injection and return consistent error responses.
16
+ - Use async handlers with async clients. Handle blocking work through the team's established sync or worker path. Scope and release sessions and clients predictably.
17
+
18
+ ## Guardrails and trade-offs
19
+
20
+ - Set limits for uploads, pagination, and expensive queries. Keep raw exception text and credentials outside public responses and structured logs.
21
+ - Treat status codes, response shapes, and generated OpenAPI as compatibility surfaces. Review client generation or event consumers before changing them.
22
+
23
+ ## Decisions to check
24
+
25
+ Model pagination and error responses explicitly when clients depend on them. Use dependency overrides only in tests and reset overrides between cases. Use the project job mechanism for durable work that must survive restarts.
26
+
27
+ ## Review scenario
28
+
29
+ For a partial update, test omitted fields separately from fields explicitly set to null. Verify response serialization excludes internal fields.
30
+
31
+ ## Verification
32
+
33
+ Run API tests with the project test client and override dependencies at the test boundary. Verify authorization failures, validation errors, response shape, and lifespan cleanup.
34
+
35
+ ## Reference
36
+
37
+ - [FastAPI documentation](https://fastapi.tiangolo.com/)
@@ -1,37 +1,37 @@
1
- ---
2
- name: lyra-flutter
3
- description: "Implement Flutter widgets, navigation, state, and platform integrations."
4
- ---
5
-
6
- # Flutter
7
-
8
- ## Inspect the project
9
-
10
- Check SDK constraints, dependency versions, repository state-management conventions, supported devices, and existing tests.
11
-
12
- ## Implementation practices
13
-
14
- - Keep build methods free of side effects and isolate state changes with the current architecture. Use stable keys when item identity affects state.
15
- - Release controllers and subscriptions in the owning lifecycle. Check mounted state when async work returns before using disposed widget context.
16
- - Use semantic labeling and support text scaling, keyboard interaction, and varying screen sizes. Handle offline and accessibility states in the UI.
17
-
18
- ## Guardrails and trade-offs
19
-
20
- - Protect private values in storage and logs. Validate permissions and platform-channel inputs, and handle unavailable integrations gracefully.
21
- - Measure frame performance and widget rebuilds before optimization. Keep expensive work off frame-sensitive execution where appropriate.
22
-
23
- ## Decisions to check
24
-
25
- Keep semantic labels, focus traversal, and responsive breakpoints aligned with the feature design. Use golden tests selectively for stable rendering contracts and widget tests for behavior. Rehearse platform integration behavior on each affected target.
26
-
27
- ## Review scenario
28
-
29
- For an async form, test disabled submit while pending, a failed response, and navigation away before the response arrives.
30
-
31
- ## Verification
32
-
33
- Run dart formatting checks, Flutter analysis, and widget tests. Exercise platform-specific flows and build variants where affected.
34
-
35
- ## Reference
36
-
37
- - [Flutter documentation](https://docs.flutter.dev/)
1
+ ---
2
+ name: lyra-flutter
3
+ description: "Implement Flutter widgets, navigation, state, and platform integrations."
4
+ ---
5
+
6
+ # Flutter
7
+
8
+ ## Inspect the project
9
+
10
+ Check SDK constraints, dependency versions, repository state-management conventions, supported devices, and existing tests.
11
+
12
+ ## Implementation practices
13
+
14
+ - Keep build methods free of side effects and isolate state changes with the current architecture. Use stable keys when item identity affects state.
15
+ - Release controllers and subscriptions in the owning lifecycle. Check mounted state when async work returns before using disposed widget context.
16
+ - Use semantic labeling and support text scaling, keyboard interaction, and varying screen sizes. Handle offline and accessibility states in the UI.
17
+
18
+ ## Guardrails and trade-offs
19
+
20
+ - Protect private values in storage and logs. Validate permissions and platform-channel inputs, and handle unavailable integrations gracefully.
21
+ - Measure frame performance and widget rebuilds before optimization. Keep expensive work off frame-sensitive execution where appropriate.
22
+
23
+ ## Decisions to check
24
+
25
+ Keep semantic labels, focus traversal, and responsive breakpoints aligned with the feature design. Use golden tests selectively for stable rendering contracts and widget tests for behavior. Rehearse platform integration behavior on each affected target.
26
+
27
+ ## Review scenario
28
+
29
+ For an async form, test disabled submit while pending, a failed response, and navigation away before the response arrives.
30
+
31
+ ## Verification
32
+
33
+ Run dart formatting checks, Flutter analysis, and widget tests. Exercise platform-specific flows and build variants where affected.
34
+
35
+ ## Reference
36
+
37
+ - [Flutter documentation](https://docs.flutter.dev/)
@@ -1,37 +1,37 @@
1
- ---
2
- name: lyra-github-actions
3
- description: "Review GitHub Actions triggers, job dependencies, artifacts, and permission boundaries."
4
- ---
5
-
6
- # GitHub Actions
7
-
8
- ## Inspect the project
9
-
10
- Identify triggers, trust levels, reusable workflows, protected environments, and job permissions. Trace inputs from event payloads into commands and artifacts.
11
-
12
- ## Implementation practices
13
-
14
- - Give the workflow and each job only the required permissions. Separate pull-request validation from privileged deployment and production credentials.
15
- - Use approved action versions and the repository's pinning policy. Reuse checked-in scripts and control concurrency for shared deployment environments.
16
- - Pass untrusted event data through validated environment variables or structured inputs. Keep untrusted pull-request code away from jobs with privileged tokens or secrets.
17
-
18
- ## Guardrails and trade-offs
19
-
20
- - Use explicit timeouts and report relevant artifacts with deliberate retention. Keep credentials and private test data out of logs, cache keys, and artifacts.
21
- - Use caches whose keys reflect dependencies and trust boundaries. Treat restored artifacts as data and validate provenance where they feed privileged work.
22
-
23
- ## Decisions to check
24
-
25
- Review whether a workflow uses pull_request_target, workflow_run, or reusable workflow inputs when permissions change. Validate artifact identity before a privileged job consumes it. Use federated credentials where the repository already supports them and scope trust to the intended ref or environment.
26
-
27
- ## Review scenario
28
-
29
- For a deploy workflow, verify a fork PR runs validation without gaining the permissions or inputs used by the deployment job.
30
-
31
- ## Verification
32
-
33
- Validate workflow syntax and test representative trigger paths on an appropriate branch. Review token permissions, environment approval, artifact retention, and cancellation behavior.
34
-
35
- ## Reference
36
-
37
- - [GitHub Actions documentation](https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions)
1
+ ---
2
+ name: lyra-github-actions
3
+ description: "Review GitHub Actions triggers, job dependencies, artifacts, and permission boundaries."
4
+ ---
5
+
6
+ # GitHub Actions
7
+
8
+ ## Inspect the project
9
+
10
+ Identify triggers, trust levels, reusable workflows, protected environments, and job permissions. Trace inputs from event payloads into commands and artifacts.
11
+
12
+ ## Implementation practices
13
+
14
+ - Give the workflow and each job only the required permissions. Separate pull-request validation from privileged deployment and production credentials.
15
+ - Use approved action versions and the repository's pinning policy. Reuse checked-in scripts and control concurrency for shared deployment environments.
16
+ - Pass untrusted event data through validated environment variables or structured inputs. Keep untrusted pull-request code away from jobs with privileged tokens or secrets.
17
+
18
+ ## Guardrails and trade-offs
19
+
20
+ - Use explicit timeouts and report relevant artifacts with deliberate retention. Keep credentials and private test data out of logs, cache keys, and artifacts.
21
+ - Use caches whose keys reflect dependencies and trust boundaries. Treat restored artifacts as data and validate provenance where they feed privileged work.
22
+
23
+ ## Decisions to check
24
+
25
+ Review whether a workflow uses pull_request_target, workflow_run, or reusable workflow inputs when permissions change. Validate artifact identity before a privileged job consumes it. Use federated credentials where the repository already supports them and scope trust to the intended ref or environment.
26
+
27
+ ## Review scenario
28
+
29
+ For a deploy workflow, verify a fork PR runs validation without gaining the permissions or inputs used by the deployment job.
30
+
31
+ ## Verification
32
+
33
+ Validate workflow syntax and test representative trigger paths on an appropriate branch. Review token permissions, environment approval, artifact retention, and cancellation behavior.
34
+
35
+ ## Reference
36
+
37
+ - [GitHub Actions documentation](https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions)