feat: add injection preview functionality and enhance specs management

- Implemented injection preview feature in InjectionControlTab with file listing and content preview.
- Added new API endpoint for fetching injection preview data.
- Introduced content length caching for performance optimization.
- Enhanced spec loading to support category filtering.
- Updated localization files for new features and terms.
- Created new personal and project specs for coding style and architecture constraints.
- Improved CLI options for category selection in spec commands.
This commit is contained in:
catlog22
2026-02-27 09:45:28 +08:00
parent dfa8e0d9f5
commit 3f25dbb11b
15 changed files with 648 additions and 120 deletions

View File

@@ -0,0 +1,32 @@
---
title: "Architecture Constraints"
dimension: specs
category: planning
keywords:
- architecture
- module
- layer
- pattern
readMode: required
priority: high
---
# Architecture Constraints
## Module Boundaries
- Each module owns its data and exposes a public API
- No circular dependencies between modules
- Shared utilities live in a dedicated shared layer
## Layer Separation
- Presentation layer must not import data layer directly
- Business logic must be independent of framework specifics
- Configuration must be externalized, not hardcoded
## Dependency Rules
- External dependencies require justification
- Prefer standard library when available
- Pin dependency versions for reproducibility

View File

@@ -0,0 +1,38 @@
---
title: "Coding Conventions"
dimension: specs
category: general
keywords:
- typescript
- naming
- style
- convention
readMode: required
priority: high
---
# Coding Conventions
## Naming
- Use camelCase for variables and functions
- Use PascalCase for classes and interfaces
- Use UPPER_SNAKE_CASE for constants
## Formatting
- 2-space indentation
- Single quotes for strings
- Trailing commas in multi-line constructs
## Patterns
- Prefer composition over inheritance
- Use early returns to reduce nesting
- Keep functions under 30 lines when practical
## Error Handling
- Always handle errors explicitly
- Prefer typed errors over generic catch-all
- Log errors with sufficient context