agent-lyra 0.6.1 → 0.6.3
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/LICENSE +21 -21
- package/README.md +435 -395
- package/bin/agent-lyra.js +49 -44
- package/bin/lyra-oss-preview.js +16 -0
- package/package.json +60 -60
- package/src/app-builder/export.js +109 -109
- package/src/app-builder/gateway.js +62 -62
- package/src/app-builder/init.js +52 -52
- package/src/app-builder/manifest-contract.js +46 -0
- package/src/app-builder/native-adapter.js +29 -29
- package/src/app-builder/preview.js +22 -22
- package/src/app-builder/publish.js +14 -14
- package/src/app-builder/saved-app.js +70 -70
- package/src/app-builder/saved-preview-browser.js +33 -33
- package/src/app-builder/saved-preview.html +24 -24
- package/src/app-builder/saved-preview.js +61 -61
- package/src/app-builder/support-manifest.js +50 -50
- package/src/app-builder/support-template/manifest.json +55 -55
- package/src/app-builder/support-template/support-preview.html +56 -56
- package/src/app-builder/support-template/support-preview.js +37 -37
- package/src/app-builder/support-template/support-preview.mjs +67 -67
- package/src/app-builder/support-template/support-workflow.mjs +36 -36
- package/src/app-builder/use.js +37 -37
- package/src/app-builder/validate.js +21 -64
- package/src/app-builder/value-schema.js +37 -37
- package/src/catalog.js +147 -147
- package/src/coding/catalog.js +56 -0
- package/src/coding/cloud-catalog.js +64 -0
- package/src/coding/detect-stack.mjs +110 -0
- package/src/coding/export.js +130 -0
- package/src/coding/setup.js +175 -0
- package/src/coding/skills/lyra-android/SKILL.md +37 -0
- package/src/coding/skills/lyra-angular/SKILL.md +37 -0
- package/src/coding/skills/lyra-cucumber/SKILL.md +37 -0
- package/src/coding/skills/lyra-dbt/SKILL.md +37 -0
- package/src/coding/skills/lyra-django/SKILL.md +37 -0
- package/src/coding/skills/lyra-docker/SKILL.md +37 -0
- package/src/coding/skills/lyra-dotnet/SKILL.md +37 -0
- package/src/coding/skills/lyra-express/SKILL.md +37 -0
- package/src/coding/skills/lyra-fastapi/SKILL.md +37 -0
- package/src/coding/skills/lyra-flutter/SKILL.md +37 -0
- package/src/coding/skills/lyra-github-actions/SKILL.md +37 -0
- package/src/coding/skills/lyra-gitlab-ci/SKILL.md +37 -0
- package/src/coding/skills/lyra-go/SKILL.md +37 -0
- package/src/coding/skills/lyra-ios/SKILL.md +37 -0
- package/src/coding/skills/lyra-kubernetes/SKILL.md +37 -0
- package/src/coding/skills/lyra-mongodb/SKILL.md +37 -0
- package/src/coding/skills/lyra-mysql/SKILL.md +37 -0
- package/src/coding/skills/lyra-nextjs/SKILL.md +37 -0
- package/src/coding/skills/lyra-node/SKILL.md +37 -0
- package/src/coding/skills/lyra-playwright/SKILL.md +37 -0
- package/src/coding/skills/lyra-postgresql/SKILL.md +37 -0
- package/src/coding/skills/lyra-python/SKILL.md +37 -0
- package/src/coding/skills/lyra-react/SKILL.md +37 -0
- package/src/coding/skills/lyra-react-native/SKILL.md +37 -0
- package/src/coding/skills/lyra-redis/SKILL.md +37 -0
- package/src/coding/skills/lyra-rust/SKILL.md +37 -0
- package/src/coding/skills/lyra-spark/SKILL.md +37 -0
- package/src/coding/skills/lyra-spring-boot/SKILL.md +37 -0
- package/src/coding/skills/lyra-svelte/SKILL.md +37 -0
- package/src/coding/skills/lyra-terraform/SKILL.md +37 -0
- package/src/coding/skills/lyra-typescript/SKILL.md +37 -0
- package/src/coding/skills/lyra-vue/SKILL.md +37 -0
- package/src/gated/hostedAgents.js +56 -56
- package/src/gated/index.d.ts +25 -25
- package/src/gated/index.js +5 -5
- package/src/index.d.ts +2 -2
- package/src/index.js +2 -2
- package/src/init.js +965 -937
- package/src/memory/cli.js +21 -49
- package/src/memory/contract.json +28 -28
- package/src/memory/index.d.ts +49 -49
- package/src/memory/index.js +259 -259
- package/src/memory/lifecycle.js +29 -29
- package/src/memory/local-cli.js +34 -0
- package/src/memory/proposals.js +84 -84
- package/src/memory/skills-cli.js +26 -26
- package/src/memory/sync.js +89 -85
- package/src/memory/validation.js +25 -25
- package/src/onboardingAgents.js +532 -532
- package/src/promptTemplates.js +178 -178
- package/src/runtime/contracts.d.ts +47 -47
- package/src/runtime/local-cli.js +160 -160
- package/src/runtime/mcp-stdio.js +111 -111
- package/src/runtime/orchestration.js +59 -59
- package/src/runtime/run-agent.js +43 -43
- package/src/standalone/index.d.ts +45 -45
- package/src/standalone/index.js +13 -13
- package/src/standalone/init.js +12 -0
- package/src/standalone/orchestration.js +6 -6
- package/src/standalone/rag.js +113 -113
- package/src/studio/agent-ui.css +43 -43
- package/src/studio/agent-ui.js +32 -32
- package/src/studio/browser.js +331 -331
- package/src/studio/export.js +80 -80
- package/src/studio/index.html +37 -37
- package/src/studio/memory-actions.js +37 -37
- package/src/studio/memory-panel.js +200 -200
- package/src/studio/project.js +216 -197
- package/src/studio/pull-agent.js +72 -72
- package/src/studio/push.js +54 -54
- package/src/studio/python-agent.js +47 -47
- package/src/studio/python-agent.py +25 -25
- package/src/studio/server.js +143 -143
- package/src/studio/session.js +83 -83
- package/src/studio/studio.css +10 -10
- package/src/studio/sync.js +42 -42
- package/src/studio/workflow-sync.js +157 -157
|
@@ -0,0 +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/)
|
|
@@ -0,0 +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)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lyra-gitlab-ci
|
|
3
|
+
description: "Implement and review GitLab pipelines, rules, runner boundaries, and deployment jobs."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# GitLab CI
|
|
7
|
+
|
|
8
|
+
## Inspect the project
|
|
9
|
+
|
|
10
|
+
Read includes, workflow rules, job rules, runner tags, protected refs, and environment approvals. Determine which pipeline types should run each job.
|
|
11
|
+
|
|
12
|
+
## Implementation practices
|
|
13
|
+
|
|
14
|
+
- Use workflow and job rules to avoid duplicate pipelines. Declare job dependencies explicitly and transfer only the necessary artifacts.
|
|
15
|
+
- Separate merge-request verification from publishing and deployment. Use least-privilege job tokens and keep protected secrets restricted to approved jobs and refs.
|
|
16
|
+
- Avoid interpolating untrusted variables into shell syntax. Use protected environments and serialized deployments when jobs share a target.
|
|
17
|
+
|
|
18
|
+
## Guardrails and trade-offs
|
|
19
|
+
|
|
20
|
+
- Key caches by dependencies and relevant runtime settings. Set artifact lifetime and exclude secrets, private fixtures, and extraneous build output.
|
|
21
|
+
- Handle manual, skipped, and failed dependencies deliberately. Confirm retry behavior for writes and preserve the correct commit identity through deployment.
|
|
22
|
+
|
|
23
|
+
## Decisions to check
|
|
24
|
+
|
|
25
|
+
Distinguish variables available during config evaluation from those created in a job. Verify matrix job names and needs relationships where partial fan-out is intentional. Review whether shared runners and artifacts cross trust boundaries.
|
|
26
|
+
|
|
27
|
+
## Review scenario
|
|
28
|
+
|
|
29
|
+
For a release job, verify it cannot run with protected credentials from an untrusted branch and that a required test failure blocks publication.
|
|
30
|
+
|
|
31
|
+
## Verification
|
|
32
|
+
|
|
33
|
+
Validate with the project's CI lint and exercise expected branch, merge request, and tag conditions. Check job graph, artifact transfer, and cancellation behavior.
|
|
34
|
+
|
|
35
|
+
## Reference
|
|
36
|
+
|
|
37
|
+
- [GitLab CI documentation](https://docs.gitlab.com/ci/yaml/)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lyra-go
|
|
3
|
+
description: "Implement Go packages and services with predictable cancellation, errors, and concurrency."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Go
|
|
7
|
+
|
|
8
|
+
## Inspect the project
|
|
9
|
+
|
|
10
|
+
Check go.mod, workspace membership, toolchain version, build tags, and the project's package boundaries.
|
|
11
|
+
|
|
12
|
+
## Implementation practices
|
|
13
|
+
|
|
14
|
+
- Pass context through call chains that perform I/O. Propagate deadlines, call cancellation functions, and close bodies or files at the owning layer.
|
|
15
|
+
- Wrap errors where context matters and preserve errors.Is or errors.As behavior for callers. Avoid panics for expected invalid inputs or transient failures.
|
|
16
|
+
- Bound concurrent work. Define goroutine ownership and channel closure clearly, and ensure workers can exit on cancellation.
|
|
17
|
+
|
|
18
|
+
## Guardrails and trade-offs
|
|
19
|
+
|
|
20
|
+
- Set explicit HTTP server and client timeouts where appropriate. Validate inputs and avoid logging tokens, request bodies, or private configuration.
|
|
21
|
+
- Keep exported interfaces narrow and control dependencies. Use metrics and profiles before optimizing allocation or concurrency.
|
|
22
|
+
|
|
23
|
+
## Decisions to check
|
|
24
|
+
|
|
25
|
+
Prefer a clear owner for synchronization and thresholds over introducing an unbounded abstraction. When changing an exported interface, test representative downstream call sites. Run the race detector for concurrency changes on a supported target.
|
|
26
|
+
|
|
27
|
+
## Review scenario
|
|
28
|
+
|
|
29
|
+
For a worker pool, test cancellation with pending work, an error from one worker, and completion without leaked goroutines.
|
|
30
|
+
|
|
31
|
+
## Verification
|
|
32
|
+
|
|
33
|
+
Run gofmt, go test, and applicable race checks and vet commands. Verify the supported platform and build tags for platform-specific changes.
|
|
34
|
+
|
|
35
|
+
## Reference
|
|
36
|
+
|
|
37
|
+
- [Go documentation](https://go.dev/doc/effective_go)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lyra-ios
|
|
3
|
+
description: "Implement iOS features across UI state, lifecycle, concurrency, and permissions."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# iOS
|
|
7
|
+
|
|
8
|
+
## Inspect the project
|
|
9
|
+
|
|
10
|
+
Check the deployment targets, Xcode and Swift versions, SwiftUI or UIKit boundaries, schemes, and signing requirements for the task.
|
|
11
|
+
|
|
12
|
+
## Implementation practices
|
|
13
|
+
|
|
14
|
+
- Keep UI updates on the appropriate main actor and adopt structured concurrency consistent with the project. Handle task cancellation and lifecycle transitions.
|
|
15
|
+
- Define navigation and state ownership clearly. Cover Dynamic Type, VoiceOver labels, safe areas, and differing layout sizes.
|
|
16
|
+
- Request permissions close to the feature that needs them and handle denial. Keep sensitive data in approved storage and validate inbound URLs and inputs.
|
|
17
|
+
|
|
18
|
+
## Guardrails and trade-offs
|
|
19
|
+
|
|
20
|
+
- Avoid retaining short-lived UI objects across asynchronous work. Inspect Swift concurrency diagnostics and persistence migration behavior where relevant.
|
|
21
|
+
- Verify differences between simulator and physical device for platform integrations. Measure performance with representative devices and build settings.
|
|
22
|
+
|
|
23
|
+
## Decisions to check
|
|
24
|
+
|
|
25
|
+
Match persistence and file protection to product requirements. Observe cancellation when leaving a view and review structured concurrency ownership. Check migration and upgrade behavior using test app data across the affected deployment targets.
|
|
26
|
+
|
|
27
|
+
## Review scenario
|
|
28
|
+
|
|
29
|
+
For a data-loading screen, test cancellation when the view disappears and verify slow responses cannot update stale state.
|
|
30
|
+
|
|
31
|
+
## Verification
|
|
32
|
+
|
|
33
|
+
Run the project's build and tests for affected schemes. Verify simulator and physical device flows as applicable, and report platform checks that require access.
|
|
34
|
+
|
|
35
|
+
## Reference
|
|
36
|
+
|
|
37
|
+
- [iOS documentation](https://developer.apple.com/documentation/)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lyra-kubernetes
|
|
3
|
+
description: "Review Kubernetes workload manifests, rollout behavior, and operational boundaries."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Kubernetes
|
|
7
|
+
|
|
8
|
+
## Inspect the project
|
|
9
|
+
|
|
10
|
+
Check the cluster version, namespace, deployment method, and existing security and resource policies. Locate the controller and rendered manifests.
|
|
11
|
+
|
|
12
|
+
## Implementation practices
|
|
13
|
+
|
|
14
|
+
- Define readiness, liveness, and startup probes according to their distinct jobs. Set resource requests from measured demand and consider limits and disruption policy.
|
|
15
|
+
- Review rollout strategy, termination grace, and stateful storage requirements. Confirm selectors and services match the intended pods.
|
|
16
|
+
- Use least-privilege service accounts and restrict container privileges and network access according to the project. Keep secrets in approved stores and references.
|
|
17
|
+
|
|
18
|
+
## Guardrails and trade-offs
|
|
19
|
+
|
|
20
|
+
- Validate the rendered manifests and API versions. Check whether changes to immutable fields require a controlled replacement.
|
|
21
|
+
- Track events, rollout state, error rates, and saturation. Rehearse rollback with dependencies and persistent state accounted for.
|
|
22
|
+
|
|
23
|
+
## Decisions to check
|
|
24
|
+
|
|
25
|
+
Confirm that resource changes target the correct namespace and context. Inspect the rendered output for privilege, image, and storage changes before rollout. Use deployment status and application metrics to determine readiness from a user's perspective.
|
|
26
|
+
|
|
27
|
+
## Review scenario
|
|
28
|
+
|
|
29
|
+
For an API rollout, verify readiness becomes false before new traffic is accepted during drain and that old pods complete in-flight work as designed.
|
|
30
|
+
|
|
31
|
+
## Verification
|
|
32
|
+
|
|
33
|
+
Run manifest and policy checks, and verify deployment in a test namespace where available. Report health, rollout, resource, and rollback observations.
|
|
34
|
+
|
|
35
|
+
## Reference
|
|
36
|
+
|
|
37
|
+
- [Kubernetes documentation](https://kubernetes.io/docs/concepts/)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lyra-mongodb
|
|
3
|
+
description: "Design and review MongoDB schemas, indexes, queries, and migrations."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# MongoDB
|
|
7
|
+
|
|
8
|
+
## Inspect the project
|
|
9
|
+
|
|
10
|
+
Inspect server version, replica or sharding topology, driver behavior, and actual query shapes. Identify document ownership, cardinality, and existing field versions.
|
|
11
|
+
|
|
12
|
+
## Implementation practices
|
|
13
|
+
|
|
14
|
+
- Embed data read and bounded together. Reference data with independent lifecycles or unbounded growth. Define authoritative fields and required invariants.
|
|
15
|
+
- Use indexes that match real filters and sorts. Verify explain output with representative cardinality and record index build and write costs.
|
|
16
|
+
- Use explicit field filters and structured queries. Scope writes by authenticated ownership, validate input, and limit privileges of app and migration accounts.
|
|
17
|
+
|
|
18
|
+
## Guardrails and trade-offs
|
|
19
|
+
|
|
20
|
+
- Use single-document atomic operators for local invariants. Use transactions for cross-document invariants with explicit retry and idempotency behavior.
|
|
21
|
+
- Roll out schema changes with compatible readers and writers first, then a resumable backfill. Plan uniqueness checks before index enforcement and protect production data during rehearsal.
|
|
22
|
+
|
|
23
|
+
## Decisions to check
|
|
24
|
+
|
|
25
|
+
Distinguish missing from null as a schema decision. Store dates and query keys with consistent BSON types and exercise filters against historical documents. Inspect index selectivity and avoid loading large arrays to filter them in application memory.
|
|
26
|
+
|
|
27
|
+
## Review scenario
|
|
28
|
+
|
|
29
|
+
For tenant-scoped uniqueness, confirm existing duplicates are resolved and verify the compound key prevents a second record only within the same tenant.
|
|
30
|
+
|
|
31
|
+
## Verification
|
|
32
|
+
|
|
33
|
+
Test representative existing documents, concurrent writes, and rollback compatibility with synthetic data. Check query plans, migration checkpoints, and operational impact.
|
|
34
|
+
|
|
35
|
+
## Reference
|
|
36
|
+
|
|
37
|
+
- [MongoDB documentation](https://www.mongodb.com/docs/manual/core/data-modeling-introduction/)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lyra-mysql
|
|
3
|
+
description: "Design and review MySQL query paths, schemas, transactions, and migrations."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# MySQL
|
|
7
|
+
|
|
8
|
+
## Inspect the project
|
|
9
|
+
|
|
10
|
+
Check server version, storage engine, SQL mode, collation, and replication topology. Determine representative data distribution and existing constraints.
|
|
11
|
+
|
|
12
|
+
## Implementation practices
|
|
13
|
+
|
|
14
|
+
- Use explicit types and defaults, and parameterize query values. Review case sensitivity, time zone handling, and how nulls affect uniqueness and filters.
|
|
15
|
+
- Match composite indexes to query filters and ordering. Review EXPLAIN and real workload measurements before accepting an index change.
|
|
16
|
+
- Check transaction isolation and lock acquisition order. Handle deadlocks and transient conflicts with bounded retries where operations are safe to repeat.
|
|
17
|
+
|
|
18
|
+
## Guardrails and trade-offs
|
|
19
|
+
|
|
20
|
+
- Verify online DDL support and expected lock behavior for the installed version. Rehearse schema changes on representative data and plan deploy ordering.
|
|
21
|
+
- Use least-privilege credentials and approved backup and restore plans. Protect the data used for migration rehearsals and query analysis.
|
|
22
|
+
|
|
23
|
+
## Decisions to check
|
|
24
|
+
|
|
25
|
+
Check differences between development and production collation, SQL mode, and timezone before assuming equality or ordering semantics. Verify that generated columns and indexes are supported by the deployed version. Treat auto-increment values as identifiers without encoding chronological guarantees.
|
|
26
|
+
|
|
27
|
+
## Review scenario
|
|
28
|
+
|
|
29
|
+
For a backfill, use stable key-based batches and record progress. Check the query plan and concurrent updates before enabling the operation at scale.
|
|
30
|
+
|
|
31
|
+
## Verification
|
|
32
|
+
|
|
33
|
+
Run integration tests for constraints and concurrent writes. Verify old and new readers, migration recovery, and replication impact when relevant.
|
|
34
|
+
|
|
35
|
+
## Reference
|
|
36
|
+
|
|
37
|
+
- [MySQL documentation](https://dev.mysql.com/doc/)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lyra-nextjs
|
|
3
|
+
description: "Implement and review routing, rendering, caching, and mutations in Next.js applications."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Next.js
|
|
7
|
+
|
|
8
|
+
## Inspect the project
|
|
9
|
+
|
|
10
|
+
Identify App Router or Pages Router, the installed Next.js version, deployment runtime, and current cache policy. Locate the route, data owner, and authentication boundary.
|
|
11
|
+
|
|
12
|
+
## Implementation practices
|
|
13
|
+
|
|
14
|
+
- In App Router, use Server Components for server-only reads. Keep client boundaries narrow for interactivity and pass serializable props. Use the router's existing loading, error, and layout patterns.
|
|
15
|
+
- Decide per route whether content can be shared, revalidated, or rendered for an individual user. Check the installed version's fetch and route defaults before relying on them.
|
|
16
|
+
- Validate and authorize each mutation and route handler against its resource. Keep privileged modules and secrets server-side. Validate route parameters and redirect destinations.
|
|
17
|
+
|
|
18
|
+
## Guardrails and trade-offs
|
|
19
|
+
|
|
20
|
+
- Confirm that public environment variables and rendered props contain only public data. Review image sources, CSP, and permissions for remote content according to repository policy.
|
|
21
|
+
- Avoid duplicate client requests when a route already provides the data. Measure production JavaScript and server latency before changing code splitting or streaming behavior.
|
|
22
|
+
|
|
23
|
+
## Decisions to check
|
|
24
|
+
|
|
25
|
+
Keep cache invalidation close to the mutation that makes data stale. Check static versus dynamic output during the build and validate downstream CDN behavior for personalized routes. Use the project's framework APIs for metadata and image sizing rather than maintaining parallel client-side logic.
|
|
26
|
+
|
|
27
|
+
## Review scenario
|
|
28
|
+
|
|
29
|
+
For account details, authorize the owner on the server and exercise navigation with two test users. Confirm that a cache hit cannot reuse one user's private content for another.
|
|
30
|
+
|
|
31
|
+
## Verification
|
|
32
|
+
|
|
33
|
+
Run the production build and route tests. Verify loading and error boundaries, hydration, authenticated responses, cache invalidation after mutation, and the deployed runtime's supported APIs.
|
|
34
|
+
|
|
35
|
+
## Reference
|
|
36
|
+
|
|
37
|
+
- [Next.js documentation](https://nextjs.org/docs)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lyra-node
|
|
3
|
+
description: "Implement Node.js services, CLIs, and modules with predictable I/O and lifecycle behavior."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Node.js
|
|
7
|
+
|
|
8
|
+
## Inspect the project
|
|
9
|
+
|
|
10
|
+
Check engines, module format, package exports, lockfile, and start command. Trace ownership of timers, sockets, subprocesses, and streams affected by the change.
|
|
11
|
+
|
|
12
|
+
## Implementation practices
|
|
13
|
+
|
|
14
|
+
- Use asynchronous I/O in request paths and honor stream backpressure. Bound batch concurrency, body sizes, and request duration. Propagate cancellation to downstream calls where supported.
|
|
15
|
+
- Keep CommonJS and ESM boundaries compatible with supported runtimes. Validate configuration once at startup and use the existing logger and structured error conventions.
|
|
16
|
+
- Close owned resources on success, failure, and shutdown. Drain in-flight work with a bounded deadline and ensure fatal startup errors reach the process exit status.
|
|
17
|
+
|
|
18
|
+
## Guardrails and trade-offs
|
|
19
|
+
|
|
20
|
+
- Pass subprocess arguments as an array and validate paths and input. Keep tokens out of command arguments and logs when a secure input mechanism exists.
|
|
21
|
+
- Avoid retrying writes without an idempotency guarantee. Use bounded retries for transient failures and measure event-loop delay when diagnosing latency.
|
|
22
|
+
|
|
23
|
+
## Decisions to check
|
|
24
|
+
|
|
25
|
+
Prefer existing runtime primitives for abort signals, streams, and filesystem operations. When writing project files, use exclusive creation for new files or an atomic replace for owned files. Handle process signals at the entry point and keep reusable modules free of process-wide side effects.
|
|
26
|
+
|
|
27
|
+
## Review scenario
|
|
28
|
+
|
|
29
|
+
For a streaming export, check slow consumers, mid-stream disconnects, and cleanup of temporary files instead of testing only tiny successful responses.
|
|
30
|
+
|
|
31
|
+
## Verification
|
|
32
|
+
|
|
33
|
+
Run the existing lint and tests on the supported Node versions. Verify the entry point, failure exit codes, cancellation, shutdown, and published import paths where relevant.
|
|
34
|
+
|
|
35
|
+
## Reference
|
|
36
|
+
|
|
37
|
+
- [Node.js documentation](https://nodejs.org/docs/latest/api/)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lyra-playwright
|
|
3
|
+
description: "Write, stabilize, and review Playwright browser tests and CI diagnostics."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Playwright
|
|
7
|
+
|
|
8
|
+
## Inspect the project
|
|
9
|
+
|
|
10
|
+
Read the installed Playwright version, test configuration, fixtures, browser projects, base URL, and CI artifact policy. Identify the user journey and the smallest appropriate test layer.
|
|
11
|
+
|
|
12
|
+
## Implementation practices
|
|
13
|
+
|
|
14
|
+
- Use role and accessible-name locators, labels, or explicit test IDs. Scope locators where similar elements repeat and use web-first assertions over visible outcomes.
|
|
15
|
+
- Give each test isolated data and browser state. Put setup and teardown in fixtures, use unique data for parallel tests, and control external dependencies at the appropriate boundary.
|
|
16
|
+
- Wait for the behavior under test. Avoid fixed sleeps and broad timeout increases. Keep assertions specific enough to diagnose the failing expectation.
|
|
17
|
+
|
|
18
|
+
## Guardrails and trade-offs
|
|
19
|
+
|
|
20
|
+
- Protect storage state, tokens, and test user credentials. Use test environments and synthetic data. Review screenshots, traces, and videos before sharing.
|
|
21
|
+
- Run targeted tests while editing and test relevant browsers when behavior differs. Use traces to distinguish stale locators, unintended requests, shared state, and application failures.
|
|
22
|
+
|
|
23
|
+
## Decisions to check
|
|
24
|
+
|
|
25
|
+
Use test fixtures to configure deterministic backend state rather than repeating UI login in every setup. Cover browser behavior at critical boundaries and keep cheaper logic tests at the unit or integration layer. If a test retries, record and diagnose the original failure before declaring it reliable.
|
|
26
|
+
|
|
27
|
+
## Review scenario
|
|
28
|
+
|
|
29
|
+
For an asynchronous save, assert the resulting confirmation or persisted state. Run the scenario repeatedly with parallel workers to detect state leakage.
|
|
30
|
+
|
|
31
|
+
## Verification
|
|
32
|
+
|
|
33
|
+
Run focused and representative cross-browser tests with the repository runner. Review traces on failures, verify retry outcomes, and report skipped environments.
|
|
34
|
+
|
|
35
|
+
## Reference
|
|
36
|
+
|
|
37
|
+
- [Playwright documentation](https://playwright.dev/docs/best-practices)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lyra-postgresql
|
|
3
|
+
description: "Design PostgreSQL schemas, queries, indexes, and low-risk migrations."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# PostgreSQL
|
|
7
|
+
|
|
8
|
+
## Inspect the project
|
|
9
|
+
|
|
10
|
+
Check the deployed PostgreSQL version, schema, existing constraints, query patterns, and migration tool. Inspect data volume and transaction durations.
|
|
11
|
+
|
|
12
|
+
## Implementation practices
|
|
13
|
+
|
|
14
|
+
- Use types and database constraints for critical invariants. Parameterize values and allowlist dynamic identifiers. Scope access at the application and database boundaries as designed.
|
|
15
|
+
- Choose indexes based on actual filters, joins, and sort order. Compare representative plans and consider write amplification and storage cost.
|
|
16
|
+
- Choose transaction isolation for the invariant. Handle serialization conflicts with a bounded retry of the whole transaction when appropriate.
|
|
17
|
+
|
|
18
|
+
## Guardrails and trade-offs
|
|
19
|
+
|
|
20
|
+
- Plan lock durations, backfills, validation, and rollout order. Keep old and new application versions compatible during deploys and use resumable batches for large data changes.
|
|
21
|
+
- Review privileges, backups and restoration, and observability of long queries or replication lag. Run execution-plan analysis that executes statements only in an appropriate environment.
|
|
22
|
+
|
|
23
|
+
## Decisions to check
|
|
24
|
+
|
|
25
|
+
Keep long transactions out of deploy paths. Check whether the migration tool wraps every statement in a transaction before choosing concurrent index operations. If a rollback can lose data, document recovery with verified backups and rehearse using a copy.
|
|
26
|
+
|
|
27
|
+
## Review scenario
|
|
28
|
+
|
|
29
|
+
For a required column on a busy table, rehearse adding a compatible column, filling existing rows in batches, validating the invariant, and enforcing it after writers are ready.
|
|
30
|
+
|
|
31
|
+
## Verification
|
|
32
|
+
|
|
33
|
+
Verify migrations on representative test data. Check old and new readers, query plans, concurrent writes, and recovery steps before a rollout.
|
|
34
|
+
|
|
35
|
+
## Reference
|
|
36
|
+
|
|
37
|
+
- [PostgreSQL documentation](https://www.postgresql.org/docs/current/)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lyra-python
|
|
3
|
+
description: "Implement and verify Python modules, packages, CLIs, and service code."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Python
|
|
7
|
+
|
|
8
|
+
## Inspect the project
|
|
9
|
+
|
|
10
|
+
Read pyproject.toml, the supported interpreter range, packaging layout, and test tools. Locate the public entry point and any sync or async contract.
|
|
11
|
+
|
|
12
|
+
## Implementation practices
|
|
13
|
+
|
|
14
|
+
- Use context managers for owned resources and narrow exception handlers at meaningful boundaries. Preserve tracebacks for diagnostics while presenting safe errors to callers.
|
|
15
|
+
- Keep defaults free of shared mutable state. Use explicit encodings for text and pathlib for paths. Validate external inputs even when static annotations are present.
|
|
16
|
+
- Keep blocking operations outside async request paths. Prefer bounded concurrency and make cleanup reliable when a task is cancelled.
|
|
17
|
+
|
|
18
|
+
## Guardrails and trade-offs
|
|
19
|
+
|
|
20
|
+
- Use an isolated environment and repository-approved dependency sources. Keep credentials outside fixtures, package artifacts, logs, and command history.
|
|
21
|
+
- Use precise type annotations at module boundaries. Reuse project formatters and linters, and document changes to import paths, CLI arguments, or returned values.
|
|
22
|
+
|
|
23
|
+
## Decisions to check
|
|
24
|
+
|
|
25
|
+
Inject clocks, paths, and clients at boundaries where tests need determinism. Avoid import-time network or filesystem work. When publishing a package, compare the wheel contents against the declared public interfaces and verify resources from the installed package.
|
|
26
|
+
|
|
27
|
+
## Review scenario
|
|
28
|
+
|
|
29
|
+
For a new CLI option, test the installed module, a path with spaces, an invalid argument, and the exit code produced on failure.
|
|
30
|
+
|
|
31
|
+
## Verification
|
|
32
|
+
|
|
33
|
+
Run the configured unit tests, type checker, and linter. For packaging changes, build the wheel and run a smoke check from a fresh install.
|
|
34
|
+
|
|
35
|
+
## Reference
|
|
36
|
+
|
|
37
|
+
- [Python documentation](https://docs.python.org/3/)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lyra-react
|
|
3
|
+
description: "Audit component ownership, state, effects, and accessible interactions in React applications."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# React
|
|
7
|
+
|
|
8
|
+
## Inspect the project
|
|
9
|
+
|
|
10
|
+
Read the installed React version, rendering framework, Strict Mode setup, and Hooks lint rules before changing a component. Trace the owning component, props, async data source, and user-visible states.
|
|
11
|
+
|
|
12
|
+
## Implementation practices
|
|
13
|
+
|
|
14
|
+
- Keep render pure. Update objects and arrays immutably, use stable domain keys in lists, and call Hooks at the top level of React components and custom Hooks.
|
|
15
|
+
- Derive filtered or formatted values during rendering. Keep transient state near the component that owns it and lift shared state to the nearest common owner. Use a reducer when transitions must stay consistent.
|
|
16
|
+
- Put user-triggered work in event handlers. Use Effects for synchronization with external systems, include reactive dependencies, and clean up subscriptions, timers, and obsolete requests.
|
|
17
|
+
|
|
18
|
+
## Guardrails and trade-offs
|
|
19
|
+
|
|
20
|
+
- Use semantic elements, accessible names, and predictable focus. Cover keyboard interaction and announce asynchronous changes when the UI needs to communicate them.
|
|
21
|
+
- Keep secrets and authorization decisions on the server. Sanitize HTML using the project's approved sanitizer before any raw HTML rendering. Measure slow renders with the Profiler before adding memoization.
|
|
22
|
+
|
|
23
|
+
## Decisions to check
|
|
24
|
+
|
|
25
|
+
When the same component switches between records, decide whether state should persist or reset. Use a stable record key when remounting reflects the product behavior. Place error boundaries around independently recoverable UI and handle event or request errors at their source. Verify the fast path before introducing transitions, Suspense, or memoization.
|
|
26
|
+
|
|
27
|
+
## Review scenario
|
|
28
|
+
|
|
29
|
+
For a search panel, derive the visible rows from the query and dataset. When the query fetches remotely, cover rapid typing followed by an older response and confirm the latest query wins.
|
|
30
|
+
|
|
31
|
+
## Verification
|
|
32
|
+
|
|
33
|
+
Run the project's lint and component tests. Cover loading, empty, error, success, keyboard behavior, and state transitions. Check hydration in SSR applications and measure any claimed performance change.
|
|
34
|
+
|
|
35
|
+
## Reference
|
|
36
|
+
|
|
37
|
+
- [React documentation](https://react.dev/reference/rules)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lyra-react-native
|
|
3
|
+
description: "Implement React Native screens and interactions across supported platforms."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# React Native
|
|
7
|
+
|
|
8
|
+
## Inspect the project
|
|
9
|
+
|
|
10
|
+
Check React Native version, Expo or native workflow, navigation library, platform versions, and configured build variants.
|
|
11
|
+
|
|
12
|
+
## Implementation practices
|
|
13
|
+
|
|
14
|
+
- Use existing component and navigation patterns. Handle safe areas, keyboard interactions, screen reader labels, and layouts for the supported device sizes.
|
|
15
|
+
- Keep network requests cancellable and design states for loading, offline, retry, and failure. Account for app lifecycle and foreground changes.
|
|
16
|
+
- Minimize overdraw and render work in long lists using the project's list primitives, stable keys, and measured optimization.
|
|
17
|
+
|
|
18
|
+
## Guardrails and trade-offs
|
|
19
|
+
|
|
20
|
+
- Request platform permissions when needed and handle rejection gracefully. Keep secrets out of application bundles and sensitive data in appropriate storage.
|
|
21
|
+
- Review native module compatibility, platform differences, and release build behavior when changing dependencies.
|
|
22
|
+
|
|
23
|
+
## Decisions to check
|
|
24
|
+
|
|
25
|
+
Test lifecycle differences around push notifications, background activity, and restoring navigation state when relevant. Check that sensitive screens and local state respect platform policies. Validate accessibility with actual platform controls where simulator behavior differs.
|
|
26
|
+
|
|
27
|
+
## Review scenario
|
|
28
|
+
|
|
29
|
+
For a list with an input form, exercise scroll performance, keyboard overlap, screen reader focus, and empty results on both platforms.
|
|
30
|
+
|
|
31
|
+
## Verification
|
|
32
|
+
|
|
33
|
+
Run JavaScript checks and device or emulator tests on applicable platforms. Verify release configuration for native dependency or permission changes.
|
|
34
|
+
|
|
35
|
+
## Reference
|
|
36
|
+
|
|
37
|
+
- [React Native documentation](https://reactnative.dev/docs/getting-started)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lyra-redis
|
|
3
|
+
description: "Implement and review Redis caches, keys, expiration, and failure handling."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Redis
|
|
7
|
+
|
|
8
|
+
## Inspect the project
|
|
9
|
+
|
|
10
|
+
Identify the deployment topology, client, eviction policy, consistency expectations, and data durability requirements.
|
|
11
|
+
|
|
12
|
+
## Implementation practices
|
|
13
|
+
|
|
14
|
+
- Use predictable key namespaces and explicit expiration where needed. Design for cache misses and define what staleness is acceptable.
|
|
15
|
+
- Use atomic commands or small reviewed scripts for multi-step invariants. Confirm cluster slot behavior if one operation touches multiple keys.
|
|
16
|
+
- Set client timeouts, bounded retries, and fallbacks. Keep the authoritative result safe when Redis is delayed, unavailable, or evicts keys.
|
|
17
|
+
|
|
18
|
+
## Guardrails and trade-offs
|
|
19
|
+
|
|
20
|
+
- Scope access with configured authentication and least privilege. Keep sensitive data out of key names and logs, and review what value data can be cached.
|
|
21
|
+
- Use bounded iteration or targeted key checks for maintenance. Track memory, latency, eviction, and connection behavior before tuning.
|
|
22
|
+
|
|
23
|
+
## Decisions to check
|
|
24
|
+
|
|
25
|
+
Define whether cached data may be shared across tenants or permission scopes before designing keys. Align expiration jitter, request coalescing, and loader concurrency with workload when stampedes are material. Treat distributed locks as a separate correctness concern and document failure assumptions.
|
|
26
|
+
|
|
27
|
+
## Review scenario
|
|
28
|
+
|
|
29
|
+
For cache invalidation after a write, test the hit, miss, concurrent update, and backend fallback with a realistic expiration policy.
|
|
30
|
+
|
|
31
|
+
## Verification
|
|
32
|
+
|
|
33
|
+
Test the code against the target topology or an appropriate fixture. Verify expiry and recovery under simulated Redis unavailability.
|
|
34
|
+
|
|
35
|
+
## Reference
|
|
36
|
+
|
|
37
|
+
- [Redis documentation](https://redis.io/docs/latest/develop/)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lyra-rust
|
|
3
|
+
description: "Implement Rust crates with sound ownership, stable contracts, and targeted verification."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Rust
|
|
7
|
+
|
|
8
|
+
## Inspect the project
|
|
9
|
+
|
|
10
|
+
Read Cargo.toml, workspace features, edition, minimum supported Rust version, and CI feature combinations.
|
|
11
|
+
|
|
12
|
+
## Implementation practices
|
|
13
|
+
|
|
14
|
+
- Use ownership and borrowing that express the intended lifetime. Prefer explicit Results for recoverable failures and preserve useful error context.
|
|
15
|
+
- Keep unsafe blocks small and justified by documented invariants. Reuse safe library APIs where they meet the task, and avoid unchecked external input assumptions.
|
|
16
|
+
- Bound asynchronous work and account for cancellation. Keep blocking operations outside async executors unless routed through appropriate mechanisms.
|
|
17
|
+
|
|
18
|
+
## Guardrails and trade-offs
|
|
19
|
+
|
|
20
|
+
- Review dependencies, feature unification, and platform support. Avoid exposing private values through Debug output or error messages.
|
|
21
|
+
- Maintain public types, feature gates, and serialization compatibility. Benchmark a targeted workload before claiming an optimization.
|
|
22
|
+
|
|
23
|
+
## Decisions to check
|
|
24
|
+
|
|
25
|
+
Choose synchronization primitives that match contention and blocking behavior. Confirm that holding resources across await points is intentional. For a public crate, verify defaults and optional feature combinations before changing shared dependencies.
|
|
26
|
+
|
|
27
|
+
## Review scenario
|
|
28
|
+
|
|
29
|
+
For a parser change, test malformed and truncated inputs, bounds, and behavior on expected valid forms without relying on panic paths.
|
|
30
|
+
|
|
31
|
+
## Verification
|
|
32
|
+
|
|
33
|
+
Run cargo fmt checks, project Clippy settings, and tests for relevant features and targets. Verify the minimum supported compiler where required.
|
|
34
|
+
|
|
35
|
+
## Reference
|
|
36
|
+
|
|
37
|
+
- [Rust documentation](https://doc.rust-lang.org/book/)
|