mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-11 17:21:03 +08:00
feat: 添加架构约束和编码规范文档,增强项目文档的完整性
This commit is contained in:
6
.ccw/specs/architecture-constraints.md
Normal file
6
.ccw/specs/architecture-constraints.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# Architecture Constraints
|
||||||
|
|
||||||
|
## Schema Evolution
|
||||||
|
|
||||||
|
- [compatibility] When enhancing existing schemas, use optional fields and additionalProperties rather than creating new schemas. Avoid breaking changes.
|
||||||
|
- [portability] Use relative paths for cross-artifact navigation to ensure portability across different environments and installations.
|
||||||
17
.ccw/specs/coding-conventions.md
Normal file
17
.ccw/specs/coding-conventions.md
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Coding Conventions
|
||||||
|
|
||||||
|
## Navigation & Path Handling
|
||||||
|
|
||||||
|
- [navigation] When creating navigation links between artifacts, always compute relative paths from the artifact's actual location, not from an assumed location. Test path resolution before committing. (learned: 2026-03-07)
|
||||||
|
- [schema] Always include schema_version field in index/registry files to enable safe evolution and migration detection. (learned: 2026-03-07)
|
||||||
|
- [error-handling] When adding version checks or validation, always continue with degraded functionality rather than failing hard. Log warnings but don't block execution. (learned: 2026-03-07)
|
||||||
|
|
||||||
|
## Document Generation
|
||||||
|
|
||||||
|
- [architecture] For document generation systems, adopt Layer 3→2→1 pattern (components → features → indexes) for efficient incremental updates. (learned: 2026-03-07)
|
||||||
|
|
||||||
|
## Implementation Quality
|
||||||
|
|
||||||
|
- [validation] Path calculation errors are subtle and hard to spot in static review. Always verify path resolution from the actual file location, not from documentation. (learned: 2026-03-07)
|
||||||
|
- [implementation] Declaring "add X to Y" in documentation is not enough - the actual logic must be implemented in the target files. (learned: 2026-03-07)
|
||||||
|
- [clarity] Explicit instructions are better than implicit ones. Vague instructions like "Update _index.md files" should be made explicit (e.g., "Update sessions/_index.md"). (learned: 2026-03-07)
|
||||||
@@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
# Workflow runtime data
|
# Workflow runtime data
|
||||||
.workflow/
|
.workflow/
|
||||||
|
.ccw/
|
||||||
|
|
||||||
# Test files
|
# Test files
|
||||||
test/
|
test/
|
||||||
|
|||||||
@@ -1031,6 +1031,10 @@ class DeepWikiStore:
|
|||||||
Returns:
|
Returns:
|
||||||
Staleness score between 0.0 and 1.0.
|
Staleness score between 0.0 and 1.0.
|
||||||
"""
|
"""
|
||||||
|
# Deleted symbols are maximally stale
|
||||||
|
if is_deleted:
|
||||||
|
return 1.0
|
||||||
|
|
||||||
w_t, w_c, w_s = weights
|
w_t, w_c, w_s = weights
|
||||||
|
|
||||||
# T: Time decay factor
|
# T: Time decay factor
|
||||||
@@ -1045,10 +1049,7 @@ class DeepWikiStore:
|
|||||||
C = 1 / (1 + math.exp(-churn_raw + 3)) # sigmoid centered at 3
|
C = 1 / (1 + math.exp(-churn_raw + 3)) # sigmoid centered at 3
|
||||||
|
|
||||||
# M: Symbol modification factor
|
# M: Symbol modification factor
|
||||||
if is_deleted:
|
M = min(1.0, max(0.0, proportion_changed))
|
||||||
M = 1.0
|
|
||||||
else:
|
|
||||||
M = min(1.0, max(0.0, proportion_changed))
|
|
||||||
|
|
||||||
return min(1.0, w_t * T + w_c * C + w_s * M)
|
return min(1.0, w_t * T + w_c * C + w_s * M)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user