@simplysm/sd-claude 13.0.78 → 13.0.80
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/claude/rules/sd-claude-rules.md +4 -63
- package/claude/rules/sd-simplysm-usage.md +7 -0
- package/claude/sd-session-start.sh +10 -0
- package/claude/skills/sd-api-review/SKILL.md +89 -0
- package/claude/skills/sd-check/SKILL.md +55 -57
- package/claude/skills/sd-commit/SKILL.md +37 -42
- package/claude/skills/sd-debug/SKILL.md +75 -265
- package/claude/skills/sd-document/SKILL.md +63 -53
- package/claude/skills/sd-document/_common.py +94 -0
- package/claude/skills/sd-document/extract_docx.py +19 -48
- package/claude/skills/sd-document/extract_pdf.py +22 -50
- package/claude/skills/sd-document/extract_pptx.py +17 -40
- package/claude/skills/sd-document/extract_xlsx.py +19 -40
- package/claude/skills/sd-email-analyze/SKILL.md +23 -31
- package/claude/skills/sd-email-analyze/email-analyzer.py +79 -65
- package/claude/skills/sd-init/SKILL.md +133 -0
- package/claude/skills/sd-plan/SKILL.md +69 -120
- package/claude/skills/sd-readme/SKILL.md +106 -131
- package/claude/skills/sd-review/SKILL.md +38 -155
- package/claude/skills/sd-simplify/SKILL.md +59 -0
- package/package.json +3 -2
- package/README.md +0 -297
- package/claude/refs/sd-angular.md +0 -127
- package/claude/refs/sd-code-conventions.md +0 -155
- package/claude/refs/sd-directories.md +0 -7
- package/claude/refs/sd-library-issue.md +0 -7
- package/claude/refs/sd-migration.md +0 -7
- package/claude/refs/sd-orm-v12.md +0 -81
- package/claude/refs/sd-orm.md +0 -23
- package/claude/refs/sd-service.md +0 -5
- package/claude/refs/sd-simplysm-docs.md +0 -52
- package/claude/refs/sd-solid.md +0 -68
- package/claude/refs/sd-workflow.md +0 -25
- package/claude/rules/sd-refs-linker.md +0 -52
- package/claude/sd-statusline.js +0 -296
- package/claude/skills/sd-api-name-review/SKILL.md +0 -154
- package/claude/skills/sd-brainstorm/SKILL.md +0 -215
- package/claude/skills/sd-debug/condition-based-waiting-example.ts +0 -158
- package/claude/skills/sd-debug/condition-based-waiting.md +0 -114
- package/claude/skills/sd-debug/defense-in-depth.md +0 -128
- package/claude/skills/sd-debug/find-polluter.sh +0 -64
- package/claude/skills/sd-debug/root-cause-tracing.md +0 -168
- package/claude/skills/sd-discuss/SKILL.md +0 -91
- package/claude/skills/sd-explore/SKILL.md +0 -118
- package/claude/skills/sd-plan-dev/SKILL.md +0 -294
- package/claude/skills/sd-plan-dev/code-quality-reviewer-prompt.md +0 -49
- package/claude/skills/sd-plan-dev/final-review-prompt.md +0 -50
- package/claude/skills/sd-plan-dev/implementer-prompt.md +0 -60
- package/claude/skills/sd-plan-dev/spec-reviewer-prompt.md +0 -45
- package/claude/skills/sd-review/api-reviewer-prompt.md +0 -75
- package/claude/skills/sd-review/code-reviewer-prompt.md +0 -82
- package/claude/skills/sd-review/convention-checker-prompt.md +0 -61
- package/claude/skills/sd-review/refactoring-analyzer-prompt.md +0 -92
- package/claude/skills/sd-skill/SKILL.md +0 -417
- package/claude/skills/sd-skill/anthropic-best-practices.md +0 -156
- package/claude/skills/sd-skill/cso-guide.md +0 -161
- package/claude/skills/sd-skill/examples/CLAUDE_MD_TESTING.md +0 -200
- package/claude/skills/sd-skill/persuasion-principles.md +0 -220
- package/claude/skills/sd-skill/testing-skills-with-subagents.md +0 -408
- package/claude/skills/sd-skill/writing-guide.md +0 -159
- package/claude/skills/sd-tdd/SKILL.md +0 -385
- package/claude/skills/sd-tdd/testing-anti-patterns.md +0 -317
- package/claude/skills/sd-use/SKILL.md +0 -67
- package/claude/skills/sd-worktree/SKILL.md +0 -78
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
# Code Quality Reviewer Prompt
|
|
2
|
-
|
|
3
|
-
Template for `Task(general-purpose)`.
|
|
4
|
-
Runs in parallel with spec reviewer. Fill in all `[bracketed]` sections.
|
|
5
|
-
|
|
6
|
-
```
|
|
7
|
-
You are reviewing code quality for a completed implementation.
|
|
8
|
-
|
|
9
|
-
## Implementer Report
|
|
10
|
-
|
|
11
|
-
[Paste the implementer's report: files changed, what they built]
|
|
12
|
-
|
|
13
|
-
## Review Scope
|
|
14
|
-
|
|
15
|
-
Use git diff to review only what changed:
|
|
16
|
-
|
|
17
|
-
git diff [BASE_SHA]..[HEAD_SHA]
|
|
18
|
-
|
|
19
|
-
BASE_SHA: [commit before task started]
|
|
20
|
-
HEAD_SHA: [implementer's commit SHA from report]
|
|
21
|
-
|
|
22
|
-
Focus your review on the diff output. Read surrounding code for context only when needed.
|
|
23
|
-
|
|
24
|
-
## Your Job
|
|
25
|
-
|
|
26
|
-
Read the actual code. Report only issues you're confident about — skip style nitpicks.
|
|
27
|
-
|
|
28
|
-
### Review Focus
|
|
29
|
-
|
|
30
|
-
1. **Bugs & Logic Errors**: Off-by-one, null handling, race conditions, incorrect logic
|
|
31
|
-
2. **Security**: Injection, XSS, unsafe input at system boundaries
|
|
32
|
-
3. **Code Quality**: Unnecessary complexity, duplication, dead code, unclear naming
|
|
33
|
-
4. **Error Handling**: Missing error handling at boundaries, swallowed errors
|
|
34
|
-
5. **Project Conventions**: Follow CLAUDE.md (read it if unsure about conventions)
|
|
35
|
-
6. **Test Quality**: Tests verify behavior not implementation, edge cases covered
|
|
36
|
-
|
|
37
|
-
### DO NOT flag:
|
|
38
|
-
|
|
39
|
-
- Spec compliance (that's the spec reviewer's job)
|
|
40
|
-
- Missing JSDoc (project convention: not enforced)
|
|
41
|
-
- Style preferences you're not confident about
|
|
42
|
-
|
|
43
|
-
### Report
|
|
44
|
-
|
|
45
|
-
- ❌ Critical: [must fix — bugs, security, data loss] (file:line)
|
|
46
|
-
- ⚠️ Important: [should fix — logic errors, bad patterns] (file:line)
|
|
47
|
-
- 💡 Suggestion: [confident improvement — informational only, does not block approval] (file:line)
|
|
48
|
-
- Assessment: **APPROVED** or **CHANGES_NEEDED** (only Critical/Important trigger CHANGES_NEEDED; Suggestions alone = APPROVED)
|
|
49
|
-
```
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
# Final Review Prompt
|
|
2
|
-
|
|
3
|
-
Template for `Task(general-purpose)`.
|
|
4
|
-
Run after all batches complete. Fill in all `[bracketed]` sections.
|
|
5
|
-
|
|
6
|
-
```
|
|
7
|
-
You are performing a final integration review of a multi-task implementation.
|
|
8
|
-
|
|
9
|
-
## Original Design
|
|
10
|
-
|
|
11
|
-
[FULL TEXT of the design document that corresponds to the current plan (match by topic/date in docs/plans/). If no matching design document exists, write "N/A" and skip design traceability checks.]
|
|
12
|
-
|
|
13
|
-
## Original Plan
|
|
14
|
-
|
|
15
|
-
[FULL TEXT of the complete plan]
|
|
16
|
-
|
|
17
|
-
## Completed Tasks
|
|
18
|
-
|
|
19
|
-
[For each task: summary of what was implemented, files changed, review outcomes]
|
|
20
|
-
|
|
21
|
-
## Your Job
|
|
22
|
-
|
|
23
|
-
Individual tasks already passed spec and quality reviews. Focus on cross-task integration and design traceability:
|
|
24
|
-
|
|
25
|
-
### Design Traceability (skip if Original Design is N/A)
|
|
26
|
-
|
|
27
|
-
1. **Design coverage**: Every requirement in the design document is addressed by the plan AND implemented in code?
|
|
28
|
-
2. **No drift**: Implementation matches the design intent? (not just the plan — the plan could have missed design requirements)
|
|
29
|
-
3. **Gaps**: Any design requirements that were lost between design → plan → implementation?
|
|
30
|
-
|
|
31
|
-
### Cross-Task Integration
|
|
32
|
-
|
|
33
|
-
1. **Plan completeness**: All tasks from the plan implemented?
|
|
34
|
-
2. **Integration**: Do tasks work together? Import/export chains correct?
|
|
35
|
-
3. **Consistency**: Naming and patterns consistent across tasks?
|
|
36
|
-
4. **Wiring**: No missing exports, broken imports, or dead connections?
|
|
37
|
-
|
|
38
|
-
### Verification
|
|
39
|
-
|
|
40
|
-
Detect the package manager (`pnpm-lock.yaml` → pnpm, `yarn.lock` → yarn, otherwise → npm), then run and report results:
|
|
41
|
-
- `$PM run typecheck [affected packages]`
|
|
42
|
-
- `$PM run lint [affected packages]`
|
|
43
|
-
|
|
44
|
-
### Report
|
|
45
|
-
|
|
46
|
-
- ✅ APPROVED — all tasks integrated correctly, design fully implemented, checks pass
|
|
47
|
-
- ❌ ISSUES:
|
|
48
|
-
- [Specific problems with file:line references]
|
|
49
|
-
- [Design requirements not implemented (if any)]
|
|
50
|
-
```
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# Implementer Prompt
|
|
2
|
-
|
|
3
|
-
Template for the orchestrator to send to `Task(general-purpose)`.
|
|
4
|
-
Fill in all `[bracketed]` sections.
|
|
5
|
-
|
|
6
|
-
```
|
|
7
|
-
You are implementing Task [N]: [task name]
|
|
8
|
-
|
|
9
|
-
## Task Description
|
|
10
|
-
|
|
11
|
-
[FULL TEXT of task from plan — paste everything here, do NOT reference a plan file]
|
|
12
|
-
|
|
13
|
-
## Context
|
|
14
|
-
|
|
15
|
-
[Where this task fits in the overall system]
|
|
16
|
-
[What other tasks depend on this task's output]
|
|
17
|
-
[For batch 2+: what previous batches produced and which files now exist]
|
|
18
|
-
|
|
19
|
-
## Before You Begin
|
|
20
|
-
|
|
21
|
-
If anything is unclear about requirements or approach, return your questions under a `## Questions` heading and STOP. Do not guess — do not implement.
|
|
22
|
-
|
|
23
|
-
## Plan Deviations
|
|
24
|
-
|
|
25
|
-
Plans may contain minor inaccuracies (wrong file paths, outdated API signatures, incorrect line numbers). Handle deviations by severity:
|
|
26
|
-
|
|
27
|
-
- **Minor** (file path renamed, import path different, line numbers shifted): Adapt to the actual codebase and note the deviation in your report.
|
|
28
|
-
- **Major** (API doesn't exist, approach fundamentally different, missing dependency): Return your questions under `## Questions` and STOP.
|
|
29
|
-
|
|
30
|
-
## While You Work
|
|
31
|
-
|
|
32
|
-
If you encounter something unexpected mid-implementation (missing APIs, unexpected patterns, ambiguous behavior), **ask questions rather than guess**. Return your questions under `## Questions` and STOP. It's always OK to pause and clarify.
|
|
33
|
-
|
|
34
|
-
## Your Job
|
|
35
|
-
|
|
36
|
-
0. **Before writing any code**: Read `.claude/refs/sd-code-conventions.md` and check `.claude/rules/sd-refs-linker.md` for additional refs relevant to the code you'll touch (e.g., `sd-solid.md` for SolidJS, `sd-orm.md` for ORM). Follow all project conventions — implementing a task does NOT exempt you from conventions.
|
|
37
|
-
1. Implement exactly what the task specifies — nothing more, nothing less
|
|
38
|
-
2. Write tests (follow TDD if the plan says to)
|
|
39
|
-
3. Verify: tests pass, no type errors
|
|
40
|
-
4. Self-review:
|
|
41
|
-
- **Completeness**: Every requirement implemented? Edge cases handled?
|
|
42
|
-
- **Quality**: Names clear? Code clean and maintainable?
|
|
43
|
-
- **Discipline**: Nothing overbuilt (YAGNI)? Only what was requested?
|
|
44
|
-
- **Testing**: Tests verify behavior (not implementation)? Comprehensive?
|
|
45
|
-
5. Fix anything found in self-review
|
|
46
|
-
6. Commit using conventional commit format: `type(scope): description` (e.g., `feat(solid): add ConfirmDialog component`)
|
|
47
|
-
7. Report back
|
|
48
|
-
|
|
49
|
-
Work from: [directory path]
|
|
50
|
-
|
|
51
|
-
## Report
|
|
52
|
-
|
|
53
|
-
When done, provide:
|
|
54
|
-
- Commit SHA (from step 6)
|
|
55
|
-
- Files created/modified (with brief description of changes)
|
|
56
|
-
- Plan deviations (if any — what the plan said vs. what you did and why)
|
|
57
|
-
- Test results
|
|
58
|
-
- Self-review findings (if any were fixed)
|
|
59
|
-
- Open concerns (if any)
|
|
60
|
-
```
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
# Spec Compliance Reviewer Prompt
|
|
2
|
-
|
|
3
|
-
Template for `Task(general-purpose)`.
|
|
4
|
-
Runs in parallel with quality reviewer. Fill in all `[bracketed]` sections.
|
|
5
|
-
|
|
6
|
-
```
|
|
7
|
-
You are verifying that an implementation matches its specification exactly.
|
|
8
|
-
|
|
9
|
-
## Requirements
|
|
10
|
-
|
|
11
|
-
[FULL TEXT of task requirements from the plan]
|
|
12
|
-
|
|
13
|
-
## Implementer Report
|
|
14
|
-
|
|
15
|
-
[Paste the implementer's report: files changed, what they built, test results]
|
|
16
|
-
|
|
17
|
-
## Your Job
|
|
18
|
-
|
|
19
|
-
Read the ACTUAL CODE. Do NOT trust the report — verify everything independently.
|
|
20
|
-
|
|
21
|
-
### Checklist
|
|
22
|
-
|
|
23
|
-
Categorize every finding as:
|
|
24
|
-
|
|
25
|
-
**MISSING** — requirement in spec but absent from code:
|
|
26
|
-
1. Compare spec line by line against code. Every requirement present?
|
|
27
|
-
2. Tests exist for each specified behavior?
|
|
28
|
-
3. New public APIs exported in the package's index.ts?
|
|
29
|
-
|
|
30
|
-
**EXTRA** — code present but not in spec:
|
|
31
|
-
4. Did the implementer build things not requested? (Public methods, new exports, "nice to have" features)
|
|
32
|
-
5. Private helpers are OK; public API additions without spec approval are not.
|
|
33
|
-
|
|
34
|
-
**WRONG** — present but incorrectly implemented:
|
|
35
|
-
6. Did they solve the right problem? Correct interpretation of requirements?
|
|
36
|
-
7. Do test assertions match spec expectations (not just implementation behavior)?
|
|
37
|
-
|
|
38
|
-
### Report
|
|
39
|
-
|
|
40
|
-
- ✅ APPROVED — all requirements verified in code, nothing extra
|
|
41
|
-
- ❌ CHANGES_NEEDED:
|
|
42
|
-
- MISSING: [requirement not implemented] (file:line)
|
|
43
|
-
- EXTRA: [built but not requested] (file:line)
|
|
44
|
-
- WRONG: [incorrect interpretation] (file:line)
|
|
45
|
-
```
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
# API Reviewer Prompt
|
|
2
|
-
|
|
3
|
-
Template for `Agent(general-purpose)`. Fill in `[CONVENTIONS]` and `[EXPLORE_FILES]`.
|
|
4
|
-
|
|
5
|
-
```
|
|
6
|
-
You are reviewing a library's public API for developer experience (DX).
|
|
7
|
-
Your question: "Would a first-time developer be confused or make mistakes using this API?"
|
|
8
|
-
|
|
9
|
-
## Context
|
|
10
|
-
|
|
11
|
-
1. Review the following project conventions relevant to API design and naming:
|
|
12
|
-
|
|
13
|
-
[CONVENTIONS]
|
|
14
|
-
|
|
15
|
-
2. Read these explore result files: [EXPLORE_FILES]
|
|
16
|
-
3. From the explore results' **Tagged Files → API** sections, collect all entries — these are your deep-read targets
|
|
17
|
-
|
|
18
|
-
## Step 1: Deep Review
|
|
19
|
-
|
|
20
|
-
Read each file from the API tagged list. For each:
|
|
21
|
-
1. Map the public API surface (exports, types, interfaces, function signatures)
|
|
22
|
-
2. Verify suspected API issues from screening
|
|
23
|
-
3. Look for additional issues
|
|
24
|
-
|
|
25
|
-
Look for:
|
|
26
|
-
- Naming consistency: same concept with different names, inconsistent prefix/suffix
|
|
27
|
-
- Intuitiveness: behavior can't be predicted from the name alone
|
|
28
|
-
- Type design: insufficient types for autocompletion, `any` in public interfaces, generic inference failures
|
|
29
|
-
- Defaults: basic use cases requiring excessive configuration
|
|
30
|
-
- Pattern consistency: similar tasks requiring different patterns
|
|
31
|
-
|
|
32
|
-
Internal consistency takes priority over external standards.
|
|
33
|
-
|
|
34
|
-
Do NOT report:
|
|
35
|
-
- Bugs, security, logic errors, race conditions
|
|
36
|
-
- Code complexity, duplication, readability
|
|
37
|
-
- TypeScript type system limitations (language constraints, not API flaws)
|
|
38
|
-
- Naming preferences where current name is used consistently
|
|
39
|
-
- Minor field duplication in small interfaces (< 10 fields)
|
|
40
|
-
|
|
41
|
-
## Step 2: Self-verify
|
|
42
|
-
|
|
43
|
-
1. CRITICAL = developers WILL write wrong code because of this API
|
|
44
|
-
2. Before suggesting a rename, search ALL usages — consistent usage is NOT a finding
|
|
45
|
-
3. Only report on PUBLIC API of the target
|
|
46
|
-
|
|
47
|
-
**Quality over quantity: 3 verified findings > 10 maybe-findings.**
|
|
48
|
-
|
|
49
|
-
## Constraints
|
|
50
|
-
|
|
51
|
-
- Analysis only. Do NOT modify any files.
|
|
52
|
-
- Only report issues with real evidence.
|
|
53
|
-
- CRITICAL requires proof the API actively misleads.
|
|
54
|
-
|
|
55
|
-
## Output Format
|
|
56
|
-
|
|
57
|
-
### [CRITICAL|WARNING|INFO] title
|
|
58
|
-
|
|
59
|
-
- **File**: path/to/file.ts:42
|
|
60
|
-
- **Evidence**: what you observed (include code snippet)
|
|
61
|
-
- **Issue**: what the problem is
|
|
62
|
-
- **Suggestion**: how to improve it
|
|
63
|
-
|
|
64
|
-
Start with:
|
|
65
|
-
|
|
66
|
-
## API Review Results
|
|
67
|
-
|
|
68
|
-
### Summary
|
|
69
|
-
- Files deep-reviewed: N (list them)
|
|
70
|
-
- Public API surface: brief description
|
|
71
|
-
- Findings: X CRITICAL, Y WARNING, Z INFO
|
|
72
|
-
|
|
73
|
-
### Findings
|
|
74
|
-
[findings here]
|
|
75
|
-
```
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
# Code Reviewer Prompt
|
|
2
|
-
|
|
3
|
-
Template for `Agent(general-purpose)`. Fill in `[CONVENTIONS]` and `[EXPLORE_FILES]`.
|
|
4
|
-
|
|
5
|
-
```
|
|
6
|
-
You are reviewing code for correctness and safety.
|
|
7
|
-
Your question: "Does this code produce wrong results or pose risks?"
|
|
8
|
-
|
|
9
|
-
## Context
|
|
10
|
-
|
|
11
|
-
1. Review the following project conventions relevant to correctness/safety:
|
|
12
|
-
|
|
13
|
-
[CONVENTIONS]
|
|
14
|
-
|
|
15
|
-
2. Read these explore result files: [EXPLORE_FILES]
|
|
16
|
-
3. From the explore results' **Tagged Files → CORRECTNESS** sections, collect all entries — these are your deep-read targets
|
|
17
|
-
|
|
18
|
-
## Step 1: Deep Review
|
|
19
|
-
|
|
20
|
-
Read each file from the CORRECTNESS tagged list. For each:
|
|
21
|
-
1. Verify the suspected issue from screening — is it real?
|
|
22
|
-
2. Look for additional issues the screening might have missed
|
|
23
|
-
|
|
24
|
-
Look for:
|
|
25
|
-
- Bugs: null/undefined risks, off-by-one, wrong conditions, missing return values
|
|
26
|
-
- Security: injection, XSS, auth/authz gaps, sensitive data exposure, input validation
|
|
27
|
-
- Race conditions: async ordering, shared state without synchronization
|
|
28
|
-
- Resource leaks: uncleared subscriptions/listeners, unclosed handles
|
|
29
|
-
- Error handling: swallowed exceptions, wrong fallbacks, missing propagation
|
|
30
|
-
- Architectural defects: circular dependencies, boundary violations
|
|
31
|
-
|
|
32
|
-
Do NOT report:
|
|
33
|
-
- Naming, API design, pure type quality
|
|
34
|
-
- Code complexity, duplication, readability
|
|
35
|
-
- Style preferences unless they cause actual bugs
|
|
36
|
-
- Type definitions alone without runtime trigger
|
|
37
|
-
- Speculative future risks
|
|
38
|
-
- Issues outside the reviewed files
|
|
39
|
-
|
|
40
|
-
**`any` type boundary**: Do NOT report `any` as a type quality issue. But DO report `any` if it enables a runtime crash (e.g., `(obj as any).method()` where `method` may not exist).
|
|
41
|
-
|
|
42
|
-
## Step 2: Self-verify
|
|
43
|
-
|
|
44
|
-
Before including ANY finding:
|
|
45
|
-
1. Is there runtime code that actually triggers this?
|
|
46
|
-
2. Does the evidence contradict my conclusion?
|
|
47
|
-
3. Is this within scope?
|
|
48
|
-
|
|
49
|
-
If you write "in practice this is unlikely because..." — drop it.
|
|
50
|
-
|
|
51
|
-
**Quality over quantity: 3 verified findings > 10 maybe-findings.**
|
|
52
|
-
|
|
53
|
-
## Constraints
|
|
54
|
-
|
|
55
|
-
- Analysis only. Do NOT modify any files.
|
|
56
|
-
- Only report issues where runtime behavior is demonstrably wrong or risky.
|
|
57
|
-
|
|
58
|
-
## Output Format
|
|
59
|
-
|
|
60
|
-
### [CRITICAL|WARNING|INFO] title
|
|
61
|
-
|
|
62
|
-
- **File**: path/to/file.ts:42
|
|
63
|
-
- **Evidence**: what you observed (include code snippet)
|
|
64
|
-
- **Issue**: what the problem is
|
|
65
|
-
- **Suggestion**: how to fix it
|
|
66
|
-
|
|
67
|
-
Severity:
|
|
68
|
-
- CRITICAL: Will cause bugs, outages, or security breaches
|
|
69
|
-
- WARNING: Real problem that can occur in practice
|
|
70
|
-
- INFO: Defensive improvement, low risk
|
|
71
|
-
|
|
72
|
-
Start with:
|
|
73
|
-
|
|
74
|
-
## Code Review Results
|
|
75
|
-
|
|
76
|
-
### Summary
|
|
77
|
-
- Files deep-reviewed: N (list them)
|
|
78
|
-
- Findings: X CRITICAL, Y WARNING, Z INFO
|
|
79
|
-
|
|
80
|
-
### Findings
|
|
81
|
-
[findings here]
|
|
82
|
-
```
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
# Convention Checker Prompt
|
|
2
|
-
|
|
3
|
-
Template for `Agent(general-purpose)`. Fill in `[CONVENTIONS]` and `[EXPLORE_FILES]`.
|
|
4
|
-
|
|
5
|
-
```
|
|
6
|
-
You are checking code against project conventions.
|
|
7
|
-
Your question: "Does this code violate any project-defined rules?"
|
|
8
|
-
|
|
9
|
-
## Context
|
|
10
|
-
|
|
11
|
-
1. Review the following project conventions (these are your Grep criteria):
|
|
12
|
-
|
|
13
|
-
[CONVENTIONS]
|
|
14
|
-
|
|
15
|
-
2. Read these explore result files: [EXPLORE_FILES]
|
|
16
|
-
3. Collect ALL file paths from the **File Summaries** sections — these are your Grep scope
|
|
17
|
-
|
|
18
|
-
## Step 1: Extract Grep-searchable patterns
|
|
19
|
-
|
|
20
|
-
From the conventions, extract rules that can be checked via text pattern matching.
|
|
21
|
-
|
|
22
|
-
Examples of Grep-searchable rules:
|
|
23
|
-
- `as unknown as` — prohibited
|
|
24
|
-
- `as any` — prohibited in public-facing types
|
|
25
|
-
- `export * from` or `export { } from` outside `src/index.ts` — prohibited
|
|
26
|
-
|
|
27
|
-
**Skip rules that require semantic understanding** (e.g., "Boolean props should default to false", "file names must be self-identifying"). Only check patterns that can be matched syntactically.
|
|
28
|
-
|
|
29
|
-
## Step 2: Grep for each pattern
|
|
30
|
-
|
|
31
|
-
For each prohibited pattern, run Grep across all files in scope.
|
|
32
|
-
|
|
33
|
-
For patterns with justified exceptions (e.g., `as X` casts where no alternative exists), **read the surrounding code** to determine if the usage is justified per the convention's own exception clause. Report only unjustified matches.
|
|
34
|
-
|
|
35
|
-
Do NOT skip or dismiss matches for these reasons:
|
|
36
|
-
- "Widespread usage" is NOT an exception — it means widespread violation
|
|
37
|
-
- "Codebase pattern" is NOT an exception — conventions define what's correct
|
|
38
|
-
|
|
39
|
-
## Step 3: Report
|
|
40
|
-
|
|
41
|
-
### [WARNING] title
|
|
42
|
-
|
|
43
|
-
- **File**: path/to/file.ts:42
|
|
44
|
-
- **Convention**: which rule from which convention
|
|
45
|
-
- **Evidence**: the matching code (include snippet)
|
|
46
|
-
- **Suggestion**: the fix recommended by the convention
|
|
47
|
-
|
|
48
|
-
All violations are WARNING. Use CRITICAL only if the violation causes an immediate runtime bug.
|
|
49
|
-
|
|
50
|
-
Start with:
|
|
51
|
-
|
|
52
|
-
## Convention Check Results
|
|
53
|
-
|
|
54
|
-
### Summary
|
|
55
|
-
- Files checked: N
|
|
56
|
-
- Conventions referenced: [list]
|
|
57
|
-
- Violations found: N
|
|
58
|
-
|
|
59
|
-
### Violations
|
|
60
|
-
[findings here]
|
|
61
|
-
```
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
# Refactoring Analyzer Prompt
|
|
2
|
-
|
|
3
|
-
Template for `Agent(general-purpose)`. Fill in `[CONVENTIONS]` and `[EXPLORE_FILES]`.
|
|
4
|
-
|
|
5
|
-
```
|
|
6
|
-
You are analyzing code for structural improvement and simplification.
|
|
7
|
-
Your question: "Can this code be simpler or better organized without changing its behavior?"
|
|
8
|
-
|
|
9
|
-
## Context
|
|
10
|
-
|
|
11
|
-
1. Review the following project conventions relevant to code structure:
|
|
12
|
-
|
|
13
|
-
[CONVENTIONS]
|
|
14
|
-
|
|
15
|
-
2. Read these explore result files: [EXPLORE_FILES]
|
|
16
|
-
3. From the explore results' **Tagged Files → REFACTOR** sections, collect all entries — these are your deep-read targets
|
|
17
|
-
|
|
18
|
-
## Step 1: Deep Review
|
|
19
|
-
|
|
20
|
-
Read each file from the REFACTOR tagged list. For each:
|
|
21
|
-
1. Verify suspected structural issues from screening
|
|
22
|
-
2. Look for additional opportunities
|
|
23
|
-
|
|
24
|
-
Look for:
|
|
25
|
-
|
|
26
|
-
**Simplification:**
|
|
27
|
-
- Unnecessary complexity: over-abstraction, needless indirection, complex generics
|
|
28
|
-
- Duplication: same logic repeated across files, similar functions that could be unified
|
|
29
|
-
- Readability: hard-to-follow control flow, unclear variable names, implicit behavior
|
|
30
|
-
|
|
31
|
-
**Structure:**
|
|
32
|
-
- Responsibility mixing: single module handling concerns that should be separate
|
|
33
|
-
- Abstraction level mismatch: high-level orchestration mixed with low-level details
|
|
34
|
-
- Module organization: related functionality scattered, or unrelated functionality grouped
|
|
35
|
-
- Leaking abstractions: internal details exposed through public API
|
|
36
|
-
- Coupling hotspots: changes that would cascade widely
|
|
37
|
-
|
|
38
|
-
## CRITICAL — Scope boundaries
|
|
39
|
-
|
|
40
|
-
Do NOT report:
|
|
41
|
-
- Bugs, security, logic errors, race conditions → code review
|
|
42
|
-
- Naming consistency, API design, type quality → API review
|
|
43
|
-
- Convention violations → convention checker
|
|
44
|
-
- Documentation gaps, style preferences, import ordering
|
|
45
|
-
- Performance optimization (unless also a structural improvement)
|
|
46
|
-
- Magic numbers with clear adjacent comments
|
|
47
|
-
- Small interface duplication (< 10 fields) where extraction adds indirection
|
|
48
|
-
- Issues outside the reviewed files
|
|
49
|
-
|
|
50
|
-
**Test each finding:** "Is this about CODE STRUCTURE, or about something else?"
|
|
51
|
-
|
|
52
|
-
## Step 2: Self-verify
|
|
53
|
-
|
|
54
|
-
1. **Structure test**: genuinely structural? not a bug, convention, or doc issue?
|
|
55
|
-
2. **Impact test**: would a developer actually struggle with this?
|
|
56
|
-
3. **Intentional pattern**: used consistently across the codebase? → by-design, drop.
|
|
57
|
-
4. **Separation benefit**: < ~150 lines AND tightly coupled? → splitting adds overhead, drop.
|
|
58
|
-
5. **Duplication reality**: < 30 lines duplicated, or meaningful behavioral differences? → drop.
|
|
59
|
-
|
|
60
|
-
**Quality over quantity: 3 verified structural findings > 10 mixed findings.**
|
|
61
|
-
|
|
62
|
-
## Constraints
|
|
63
|
-
|
|
64
|
-
- Analysis only. Do NOT modify any files.
|
|
65
|
-
- Do NOT provide corrected code blocks. Describe issues in words only.
|
|
66
|
-
- Only report structural issues with real evidence.
|
|
67
|
-
|
|
68
|
-
## Output Format
|
|
69
|
-
|
|
70
|
-
### [HIGH|MEDIUM|LOW] title
|
|
71
|
-
|
|
72
|
-
- **File**: path/to/file.ts:42
|
|
73
|
-
- **Evidence**: what you observed (include code snippet)
|
|
74
|
-
- **Issue**: what the structural problem is
|
|
75
|
-
- **Suggestion**: how to improve it (in words, not code)
|
|
76
|
-
|
|
77
|
-
Impact levels:
|
|
78
|
-
- HIGH: Major structural problem. Significantly harder to understand or modify safely.
|
|
79
|
-
- MEDIUM: Notable concern. Unnecessary complexity or meaningful duplication.
|
|
80
|
-
- LOW: Improvement opportunity. Cleaner structure exists but current is workable.
|
|
81
|
-
|
|
82
|
-
Start with:
|
|
83
|
-
|
|
84
|
-
## Refactoring Analysis Results
|
|
85
|
-
|
|
86
|
-
### Summary
|
|
87
|
-
- Files deep-reviewed: N (list them)
|
|
88
|
-
- Findings: X HIGH, Y MEDIUM, Z LOW
|
|
89
|
-
|
|
90
|
-
### Findings
|
|
91
|
-
[findings here]
|
|
92
|
-
```
|