-
Notifications
You must be signed in to change notification settings - Fork 0
Chore/improve scaffold rules #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…pdates - Remove .claude/commands/ directory (skills reference CLI directly) - Remove --agent, --claude flags (unified output for all agents) - Remove sandbox and slash-command conditionals from templates - Add marker-delimited sections for CLAUDE.md and AGENTS.md updates - Simplify SKILL.md with step-by-step workflow - Update tests for new ScaffoldOutput structure BREAKING CHANGE: CLI output structure changed. Now returns rulesPath, claudeMdSection, agentsMdSection, and templates fields.
- Add --list/-l flag to output available rules without full processing - Add validation warning when --rules filter contains unknown rule IDs - Export ProcessedTemplate, ScaffoldOutput types and MARKERS for consumers - Add module-organization rule to CLAUDE.md - Update template headers to reference skill instead of slash command - Add tests for new features (25 tests total)
Code Review: Chore/improve scaffold-rulesThis PR successfully simplifies the scaffold-rules implementation by removing the multi-agent abstraction layer and consolidating to a unified .plaited/rules/ approach. Score: 8/10 ✅ Key Strengths
🔍 Code Quality Issues1. Unnecessary Optional Chaining (src/scaffold-rules.ts:167)
2. Missing Error Stack Trace (src/scaffold-rules.ts:337-341)
3. Fragile Description Extraction (src/scaffold-rules.ts:161-175)
4. Regex Nested Quantifiers (src/scaffold-rules.ts:115-116, 122-123)
🎯 Testing Gaps
📋 Documentation Issues
🚀 RecommendationsRequired before merge:
Recommended (follow-up):
Overall: Approve with minor revisions. Great refactoring that simplifies the codebase! |
- Replace optional chaining with non-null assertion in extractDescription - Enhance MARKERS TSDoc with usage guidance - Add iteration limit (100) to conditional processing loop - Add edge case tests (empty filter, description fallback, nested conditionals)
Code ReviewThis PR successfully simplifies the scaffold-rules implementation by removing the multi-agent abstraction and consolidating to a unified .plaited/rules/ approach. Overall, this is a solid refactoring that improves maintainability. Strengths
Issues Found1. Missing Error Stack Trace (src/scaffold-rules.ts:349-352)When catching errors, log the full error object before extracting the message for better debugging. Add console.error(error) before line 350. Severity: Medium - Makes debugging template processing errors difficult 2. MARKERS Export Documentation (src/scaffold-rules.ts:63-66)The MARKERS export is well-documented but consider:
Severity: Low - Documentation completeness 3. Potential Infinite Loop Silent Failure (src/scaffold-rules.ts:115-121)Good addition of maxIterations counter! However, if max iterations is reached, the function silently continues with potentially unprocessed conditionals. Consider logging a warning after the while loop. Severity: Low - Edge case handling 4. Non-Null Assertion Could Be More Defensive (src/scaffold-rules.ts:179)Current code with non-null assertion is correct but could be more defensive with an explicit check and continue statement instead. Severity: Very Low - Code style preference, current code is correct Test Coverage GapsMissing edge case tests:
The existing tests cover happy paths well, but edge cases could reveal issues. RecommendationsRequired before merge:
Nice to have (can be follow-up):
Overall AssessmentScore: 8.5/10 - Excellent refactoring that significantly improves the codebase. The removal of 156+ lines of complex capability matrix logic is a major win for maintainability. The unified approach and marker-based updates are well-designed. The issues found are minor and mostly about defensive coding and observability. The core logic is sound and well-tested for happy paths. Recommendation: Approve with minor revisions - Address the two required items above, then this is ready to merge. |
- Move .claude/rules/ to .plaited/rules/ (eat our own dogfood) - Update CLAUDE.md with rules directory convention documentation - Update scaffold-rules CLI to read from .plaited/rules/ - Add rules directory convention to SKILL.md This makes the repo consistent with scaffold-rules output and documents the local vs shared rules pattern: - .plaited/rules/ - shared rules (cross-agent) - .claude/rules/ - Claude Code-specific overrides - .cursor/rules/ - Cursor-specific overrides
Code Review: Chore/improve scaffold-rulesThis PR successfully simplifies the scaffold-rules implementation by removing the multi-agent abstraction and consolidating to a unified ✅ Strengths
🔍 Issues Found1. Missing Error Stack Trace (src/scaffold-rules.ts:349-352)Severity: Medium When catching errors, the full error stack is lost. This makes debugging template processing errors difficult. } catch (error) {
const message = error instanceof Error ? error.message : String(error)
console.error(`Error processing template ${file}: ${message}`)
process.exit(1)
}Recommendation: Add } catch (error) {
console.error(`Error processing template ${file}:`, error)
const message = error instanceof Error ? error.message : String(error)
console.error(message)
process.exit(1)
}2. MARKERS Export Clarity (src/scaffold-rules.ts:63-66)Severity: Low The
Current state is acceptable, but clarification would improve API surface understanding. 3. No Warning for Max Iterations (src/scaffold-rules.ts:115-121)Severity: Low Good addition of Recommendation: Add a warning after the while loop: while (result !== previousResult && iterations < maxIterations) {
// ... existing code
}
if (iterations >= maxIterations) {
console.warn('Warning: Max iterations reached in template processing. Some conditionals may be unprocessed.')
}4. Regex Nested Quantifiers (src/scaffold-rules.ts:126, 133)Severity: Very Low The regex patterns use nested quantifiers which could theoretically cause catastrophic backtracking: /\{\{#if development-skills\}\}((?:(?!\{\{#if )(?!\{\{\^if )(?!\{\{\/if\}\})[\s\S])*?)\{\{\/if\}\}/gAssessment: Current code is safe because:
No action required, but worth noting for future template syntax additions. 📋 Test Coverage GapsMissing edge case tests:
Existing tests are strong for happy paths. Edge cases would make coverage more robust but aren't blockers. 🎯 Architecture & DesignExcellent decisions:
File organization is sound:
📝 DocumentationCLAUDE.md updates: ✅ Clear, consistent references to Minor note: The rules directory convention table is duplicated in both CLAUDE.md and SKILL.md. This is acceptable for discoverability but creates maintenance burden if conventions change. 🔒 Security ConsiderationsNo security issues found:
🚀 PerformanceExcellent performance characteristics:
Overall AssessmentScore: 8.5/10 - Excellent refactoring that significantly improves the codebase. Recommendation: Approve with minor revisions Required Before Merge:
Nice to Have (Can be Follow-up):
The core logic is sound, well-tested for happy paths, and the architectural simplification is a major win. The issues found are minor and mostly about defensive coding and observability. |
- Preserve full error stack traces in catch blocks across all LSP tools - Add max iterations warning in template processing - Add @public TSDoc tag to MARKERS export Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Code Review: Chore/improve scaffold-rulesThis PR successfully simplifies the scaffold-rules implementation by removing the multi-agent abstraction layer and consolidating to a unified ✅ Strengths
🔍 Issues Found1. Missing Error Stack Trace (src/scaffold-rules.ts:356-357)Severity: Medium - Actually FIXED The PR already improved this! Changed from string concatenation to proper error logging with full stack trace. This is a positive change. 2. Max Iterations Warning Implementation (src/scaffold-rules.ts:140-142)Severity: Low - Well implemented Good addition of 3. Regex Pattern Complexity (src/scaffold-rules.ts:128, 135)Severity: Very Low - Safe as-is The nested quantifier patterns are safe because:
No action needed. 📋 Architecture AssessmentExcellent architectural decisions:
📝 Documentation QualityCLAUDE.md updates: ✅ Excellent
SKILL.md updates: ✅ Clear workflow documentation
Code documentation: ✅ Comprehensive TSDoc
🧪 Test Coverage AssessmentStrong happy path coverage:
🔒 Security AssessmentNo security issues found:
🚀 Performance ImpactSignificant improvement:
✨ Overall AssessmentScore: 9/10 - Excellent refactoring Recommendation: ✅ APPROVE - Ready to merge No blocking issues found. All changes improve codebase quality. The error handling improvements in LSP commands are particularly welcome. 🎯 Follow-up Suggestions (Optional)Nice-to-haves for future PRs:
Great work on this refactoring! The simplification from multi-agent abstraction to unified rules directory is exactly the right direction. |
No description provided.