@su-record/vibe 2.8.23 → 2.8.25
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/commands/vibe.figma.md +2 -2
- package/dist/cli/commands/config.d.ts +17 -0
- package/dist/cli/commands/config.d.ts.map +1 -0
- package/dist/cli/commands/config.js +207 -0
- package/dist/cli/commands/config.js.map +1 -0
- package/dist/cli/commands/index.d.ts +2 -0
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +2 -0
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/info.d.ts.map +1 -1
- package/dist/cli/commands/info.js +2 -0
- package/dist/cli/commands/info.js.map +1 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +78 -54
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/stats.d.ts +13 -0
- package/dist/cli/commands/stats.d.ts.map +1 -0
- package/dist/cli/commands/stats.js +280 -0
- package/dist/cli/commands/stats.js.map +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +33 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/postinstall/constants.d.ts.map +1 -1
- package/dist/cli/postinstall/constants.js +1 -0
- package/dist/cli/postinstall/constants.js.map +1 -1
- package/dist/cli/setup/GlobalInstaller.d.ts.map +1 -1
- package/dist/cli/setup/GlobalInstaller.js +7 -7
- package/dist/cli/setup/GlobalInstaller.js.map +1 -1
- package/dist/cli/setup/ProjectSetup.d.ts.map +1 -1
- package/dist/cli/setup/ProjectSetup.js +18 -12
- package/dist/cli/setup/ProjectSetup.js.map +1 -1
- package/dist/infra/lib/ContextCompressor.d.ts.map +1 -1
- package/dist/infra/lib/ContextCompressor.js +10 -4
- package/dist/infra/lib/ContextCompressor.js.map +1 -1
- package/dist/infra/lib/ProjectCache.d.ts +2 -2
- package/dist/infra/lib/ProjectCache.d.ts.map +1 -1
- package/dist/infra/lib/ProjectCache.js +4 -3
- package/dist/infra/lib/ProjectCache.js.map +1 -1
- package/dist/infra/lib/utils.d.ts +24 -0
- package/dist/infra/lib/utils.d.ts.map +1 -1
- package/dist/infra/lib/utils.js +41 -0
- package/dist/infra/lib/utils.js.map +1 -1
- package/dist/infra/orchestrator/SmartRouter.d.ts +3 -0
- package/dist/infra/orchestrator/SmartRouter.d.ts.map +1 -1
- package/dist/infra/orchestrator/SmartRouter.js +11 -1
- package/dist/infra/orchestrator/SmartRouter.js.map +1 -1
- package/dist/infra/orchestrator/SmartRouter.test.d.ts +5 -0
- package/dist/infra/orchestrator/SmartRouter.test.d.ts.map +1 -0
- package/dist/infra/orchestrator/SmartRouter.test.js +457 -0
- package/dist/infra/orchestrator/SmartRouter.test.js.map +1 -0
- package/dist/tools/convention/analyzeComplexity.d.ts.map +1 -1
- package/dist/tools/convention/analyzeComplexity.js +18 -10
- package/dist/tools/convention/analyzeComplexity.js.map +1 -1
- package/dist/tools/convention/checkCouplingCohesion.d.ts.map +1 -1
- package/dist/tools/convention/checkCouplingCohesion.js +14 -6
- package/dist/tools/convention/checkCouplingCohesion.js.map +1 -1
- package/dist/tools/semantic/analyzeDependencyGraph.d.ts.map +1 -1
- package/dist/tools/semantic/analyzeDependencyGraph.js +1 -1
- package/dist/tools/semantic/analyzeDependencyGraph.js.map +1 -1
- package/dist/tools/semantic/findReferences.d.ts.map +1 -1
- package/dist/tools/semantic/findReferences.js +13 -13
- package/dist/tools/semantic/findReferences.js.map +1 -1
- package/dist/tools/semantic/findSymbol.d.ts.map +1 -1
- package/dist/tools/semantic/findSymbol.js +12 -13
- package/dist/tools/semantic/findSymbol.js.map +1 -1
- package/dist/tools/semantic/lsp.d.ts.map +1 -1
- package/dist/tools/semantic/lsp.js +22 -14
- package/dist/tools/semantic/lsp.js.map +1 -1
- package/hooks/hooks.json +29 -0
- package/hooks/scripts/__tests__/keyword-detector.test.js +199 -0
- package/hooks/scripts/__tests__/pre-tool-guard.test.js +286 -0
- package/hooks/scripts/__tests__/sentinel-guard.test.js +210 -0
- package/hooks/scripts/auto-commit.js +65 -0
- package/hooks/scripts/auto-format.js +64 -0
- package/hooks/scripts/auto-test.js +81 -0
- package/hooks/scripts/code-check.js +139 -0
- package/hooks/scripts/command-log.js +32 -0
- package/hooks/scripts/context-save.js +60 -6
- package/hooks/scripts/hud-status.js +32 -2
- package/hooks/scripts/llm-orchestrate.js +95 -17
- package/hooks/scripts/pr-test-gate.js +52 -0
- package/package.json +1 -1
- package/skills/agents-md/rubrics/what-to-keep.md +49 -0
- package/skills/agents-md/templates/agents-md.md +36 -0
- package/skills/arch-guard/agents/detector.md +48 -0
- package/skills/arch-guard/agents/reporter.md +48 -0
- package/skills/arch-guard/agents/rule-generator.md +49 -0
- package/skills/arch-guard/agents/violation-checker.md +51 -0
- package/skills/arch-guard/frameworks/clean-architecture.md +108 -0
- package/skills/arch-guard/frameworks/solid.md +102 -0
- package/skills/arch-guard/scripts/check-boundaries.js +90 -0
- package/skills/arch-guard/templates/arch-rules.json +47 -0
- package/skills/arch-guard/templates/violation-report.md +53 -0
- package/skills/brand-assets/rubrics/asset-checklist.md +98 -0
- package/skills/brand-assets/templates/brand-guide.md +161 -0
- package/skills/capability-loop/agents/capability-designer.md +61 -0
- package/skills/capability-loop/agents/failure-analyst.md +55 -0
- package/skills/capability-loop/agents/implementer.md +50 -0
- package/skills/capability-loop/agents/tester.md +53 -0
- package/skills/capability-loop/templates/capability-spec.md +118 -0
- package/skills/capability-loop/templates/failure-analysis.md +118 -0
- package/skills/characterization-test/agents/behavior-capturer.md +50 -0
- package/skills/characterization-test/agents/coverage-checker.md +54 -0
- package/skills/characterization-test/agents/reporter.md +50 -0
- package/skills/characterization-test/agents/test-writer.md +49 -0
- package/skills/characterization-test/rubrics/coverage-criteria.md +53 -0
- package/skills/characterization-test/templates/test-template.ts +101 -0
- package/skills/claude-md-guide/rubrics/anti-patterns.md +88 -0
- package/skills/claude-md-guide/templates/claude-md.md +54 -0
- package/skills/commerce-patterns/rubrics/checkout-flow.md +48 -0
- package/skills/commerce-patterns/templates/product-schema.md +85 -0
- package/skills/commit-push-pr/agents/change-analyzer.md +55 -0
- package/skills/commit-push-pr/agents/message-writer.md +50 -0
- package/skills/commit-push-pr/agents/pr-writer.md +58 -0
- package/skills/commit-push-pr/agents/reviewer.md +52 -0
- package/skills/commit-push-pr/rubrics/commit-message.md +73 -0
- package/skills/commit-push-pr/templates/pr-body.md +63 -0
- package/skills/context7-usage/rubrics/when-to-use.md +50 -0
- package/skills/create-prd/agents/edge-case-finder.md +48 -0
- package/skills/create-prd/agents/prioritizer.md +60 -0
- package/skills/create-prd/agents/requirements-writer.md +48 -0
- package/skills/create-prd/agents/researcher.md +55 -0
- package/skills/create-prd/agents/reviewer.md +54 -0
- package/skills/create-prd/frameworks/jobs-to-be-done.md +96 -0
- package/skills/create-prd/frameworks/rice-scoring.md +97 -0
- package/skills/create-prd/orchestrator.md +70 -0
- package/skills/create-prd/rubrics/completeness.md +58 -0
- package/skills/create-prd/templates/prd.md +139 -0
- package/skills/design-audit/agents/a11y-auditor.md +43 -0
- package/skills/design-audit/agents/performance-auditor.md +46 -0
- package/skills/design-audit/agents/responsive-auditor.md +46 -0
- package/skills/design-audit/agents/scorer.md +47 -0
- package/skills/design-audit/agents/slop-detector.md +47 -0
- package/skills/design-audit/frameworks/core-web-vitals.md +107 -0
- package/skills/design-audit/frameworks/wcag-checklist.md +64 -0
- package/skills/design-audit/orchestrator.md +64 -0
- package/skills/design-audit/rubrics/ai-slop-patterns.md +83 -0
- package/skills/design-audit/rubrics/scoring.md +63 -0
- package/skills/design-audit/templates/report.md +88 -0
- package/skills/design-critique/rubrics/ux-heuristics.md +143 -0
- package/skills/design-critique/templates/critique-report.md +86 -0
- package/skills/design-distill/templates/design-system.md +132 -0
- package/skills/design-normalize/rubrics/token-naming.md +117 -0
- package/skills/design-normalize/templates/token-audit.md +89 -0
- package/skills/design-polish/rubrics/polish-checklist.md +68 -0
- package/skills/design-polish/templates/polish-report.md +64 -0
- package/skills/design-teach/rubrics/brand-personality.md +73 -0
- package/skills/design-teach/templates/design-context.json +36 -0
- package/skills/e2e-commerce/templates/test-scenarios.md +170 -0
- package/skills/event-comms/templates/email-invite.md +99 -0
- package/skills/event-comms/templates/sns-post.md +133 -0
- package/skills/event-ops/rubrics/contingency.md +85 -0
- package/skills/event-ops/templates/d-day-checklist.md +65 -0
- package/skills/event-planning/rubrics/timeline.md +70 -0
- package/skills/event-planning/templates/event-plan.md +91 -0
- package/skills/exec-plan/agents/decomposer.md +47 -0
- package/skills/exec-plan/agents/dependency-mapper.md +44 -0
- package/skills/exec-plan/agents/estimator.md +43 -0
- package/skills/exec-plan/agents/validator.md +55 -0
- package/skills/exec-plan/orchestrator.md +70 -0
- package/skills/exec-plan/rubrics/complexity-scoring.md +75 -0
- package/skills/exec-plan/templates/plan.md +147 -0
- package/skills/git-worktree/rubrics/when-to-use.md +55 -0
- package/skills/handoff/agents/context-summarizer.md +51 -0
- package/skills/handoff/agents/document-writer.md +63 -0
- package/skills/handoff/agents/state-collector.md +53 -0
- package/skills/handoff/agents/verifier.md +48 -0
- package/skills/handoff/rubrics/completeness.md +62 -0
- package/skills/handoff/templates/handoff.md +107 -0
- package/skills/parallel-research/agents/best-practices.md +43 -0
- package/skills/parallel-research/agents/codebase-patterns.md +46 -0
- package/skills/parallel-research/agents/framework-docs.md +45 -0
- package/skills/parallel-research/agents/security-advisory.md +46 -0
- package/skills/parallel-research/agents/synthesizer.md +52 -0
- package/skills/parallel-research/experts/best-practices.md +50 -0
- package/skills/parallel-research/experts/codebase-patterns.md +70 -0
- package/skills/parallel-research/experts/framework-docs.md +65 -0
- package/skills/parallel-research/experts/security-advisory.md +69 -0
- package/skills/parallel-research/orchestrator.md +65 -0
- package/skills/parallel-research/templates/synthesis.md +101 -0
- package/skills/prioritization-frameworks/rubrics/frameworks.md +79 -0
- package/skills/prioritization-frameworks/templates/scoring-matrix.md +69 -0
- package/skills/priority-todos/rubrics/prioritization.md +70 -0
- package/skills/priority-todos/templates/todo-board.md +59 -0
- package/skills/seo-checklist/frameworks/structured-data.md +153 -0
- package/skills/seo-checklist/rubrics/content-seo.md +42 -0
- package/skills/seo-checklist/rubrics/technical-seo.md +48 -0
- package/skills/techdebt/agents/analyzer.md +50 -0
- package/skills/techdebt/agents/fixer.md +41 -0
- package/skills/techdebt/agents/reviewer.md +47 -0
- package/skills/techdebt/agents/scanner.md +44 -0
- package/skills/techdebt/orchestrator.md +70 -0
- package/skills/techdebt/rubrics/severity.md +51 -0
- package/skills/techdebt/scripts/scan.js +90 -0
- package/skills/techdebt/templates/report.md +86 -0
- package/skills/tool-fallback/rubrics/fallback-chain.md +58 -0
- package/skills/typescript-advanced-types/rubrics/type-patterns.md +109 -0
- package/skills/ui-ux-pro-max/rubrics/interaction-states.md +83 -0
- package/skills/ui-ux-pro-max/rubrics/responsive-breakpoints.md +99 -0
- package/skills/user-personas/rubrics/research-methods.md +56 -0
- package/skills/user-personas/templates/persona.md +89 -0
- package/skills/vercel-react-best-practices/rubrics/performance.md +82 -0
- package/skills/vercel-react-best-practices/rubrics/server-components.md +86 -0
- package/skills/vibe-docs/SKILL.md +171 -0
- package/skills/vibe-docs/templates/architecture.md +80 -0
- package/skills/vibe-docs/templates/readme.md +84 -0
- package/skills/vibe-docs/templates/release-notes.md +74 -0
- package/skills/vibe-figma/SKILL.md +173 -54
- package/skills/vibe-figma/rubrics/extraction-checklist.md +51 -0
- package/skills/vibe-figma/templates/figma-handoff.md +96 -0
- package/skills/vibe-figma-analyze/rubrics/analysis-dimensions.md +53 -0
- package/skills/vibe-figma-codegen/rubrics/code-quality.md +54 -0
- package/skills/vibe-figma-consolidate/templates/consolidation-report.md +95 -0
- package/skills/vibe-figma-convert/SKILL.md +176 -1
- package/skills/vibe-figma-convert/rubrics/conversion-rules.md +83 -0
- package/skills/vibe-figma-convert/templates/component.md +152 -0
- package/skills/vibe-figma-extract/rubrics/image-rules.md +67 -0
- package/skills/vibe-figma-frame/rubrics/frame-selection.md +55 -0
- package/skills/vibe-figma-pipeline/rubrics/pipeline-stages.md +96 -0
- package/skills/vibe-figma-rules/rubrics/naming-conventions.md +70 -0
- package/skills/vibe-figma-style/rubrics/style-mapping.md +100 -0
- package/skills/video-production/rubrics/quality-checklist.md +58 -0
- package/skills/video-production/templates/production-plan.md +104 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: document-writer
|
|
3
|
+
role: Writes HANDOFF.md from collected state data and session summary
|
|
4
|
+
tools: [Write, Read, Bash]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Document Writer
|
|
8
|
+
|
|
9
|
+
## Role
|
|
10
|
+
Assembles the final HANDOFF.md by combining the state snapshot and decision log into a structured document that enables the next session to continue without any ramp-up time.
|
|
11
|
+
|
|
12
|
+
## Responsibilities
|
|
13
|
+
- Merge state-collector data and context-summarizer output into one document
|
|
14
|
+
- Write completed tasks, in-progress tasks (with % and next step), and next tasks
|
|
15
|
+
- Include notes on known bugs, workarounds, and files to avoid
|
|
16
|
+
- List all relevant modified files with a one-line description of each
|
|
17
|
+
- Save the document to the project root as `HANDOFF.md`
|
|
18
|
+
|
|
19
|
+
## Input
|
|
20
|
+
- State snapshot from state-collector
|
|
21
|
+
- Decision log from context-summarizer
|
|
22
|
+
- Any explicit notes provided by the user
|
|
23
|
+
|
|
24
|
+
## Output
|
|
25
|
+
`HANDOFF.md` written to project root:
|
|
26
|
+
|
|
27
|
+
```markdown
|
|
28
|
+
# Work Handover Document
|
|
29
|
+
|
|
30
|
+
## Completed Tasks
|
|
31
|
+
- [x] JWT auth middleware implemented and tested
|
|
32
|
+
|
|
33
|
+
## In Progress
|
|
34
|
+
- [ ] Refresh token flow — 40% complete
|
|
35
|
+
- Next step: implement POST /auth/refresh endpoint
|
|
36
|
+
|
|
37
|
+
## Next Tasks
|
|
38
|
+
1. Add rate limiting to /auth/login
|
|
39
|
+
2. Write integration tests for token expiry edge cases
|
|
40
|
+
|
|
41
|
+
## Decisions & Rationale
|
|
42
|
+
{from context-summarizer}
|
|
43
|
+
|
|
44
|
+
## Notes & Cautions
|
|
45
|
+
- Do not touch src/legacy-auth.ts — will be removed next sprint
|
|
46
|
+
- Known bug: FIXME in src/middleware.ts:18
|
|
47
|
+
|
|
48
|
+
## Related Files
|
|
49
|
+
- src/auth.ts — JWT validation logic
|
|
50
|
+
- src/types.ts — AuthToken and User types
|
|
51
|
+
|
|
52
|
+
## Last State
|
|
53
|
+
- Branch: feature/auth-refactor
|
|
54
|
+
- Last commit: abc1234
|
|
55
|
+
- Test status: PASSING (24/24)
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Communication
|
|
59
|
+
- Reports findings to: verifier
|
|
60
|
+
- Receives instructions from: orchestrator (handoff skill)
|
|
61
|
+
|
|
62
|
+
## Domain Knowledge
|
|
63
|
+
Write for a developer with zero session context. The next person reading this has no memory of what happened. Every section must be self-contained.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: state-collector
|
|
3
|
+
role: Gathers current branch, commits, test status, and open TODOs for handoff
|
|
4
|
+
tools: [Bash, Glob, Grep, Read]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# State Collector
|
|
8
|
+
|
|
9
|
+
## Role
|
|
10
|
+
Takes a snapshot of the current repository state so the handoff document reflects reality. Collects factual, objective data — not interpretation. Feeds raw data to context-summarizer and document-writer.
|
|
11
|
+
|
|
12
|
+
## Responsibilities
|
|
13
|
+
- Run `git status`, `git branch`, and `git log --oneline -10` to capture branch and commit state
|
|
14
|
+
- Run the test suite (or last known test run) to record pass/fail counts
|
|
15
|
+
- Scan for open TODO/FIXME/HACK comments in recently changed files
|
|
16
|
+
- List all files modified since the last commit
|
|
17
|
+
- Check for any stashed changes or untracked files
|
|
18
|
+
|
|
19
|
+
## Input
|
|
20
|
+
- Project root path
|
|
21
|
+
- Optional: test command override (defaults to `npm test` or `npx vitest run`)
|
|
22
|
+
|
|
23
|
+
## Output
|
|
24
|
+
Raw state data bundle:
|
|
25
|
+
|
|
26
|
+
```markdown
|
|
27
|
+
## State Snapshot
|
|
28
|
+
|
|
29
|
+
### Git State
|
|
30
|
+
- Branch: feature/auth-refactor
|
|
31
|
+
- Last commit: abc1234 "Add JWT validation"
|
|
32
|
+
- Uncommitted changes: 3 files (src/auth.ts, src/types.ts, tests/auth.test.ts)
|
|
33
|
+
- Stashed: none
|
|
34
|
+
|
|
35
|
+
### Test Status
|
|
36
|
+
- Last run: PASSING (24 passed, 0 failed)
|
|
37
|
+
- Coverage: 87%
|
|
38
|
+
|
|
39
|
+
### Open TODOs
|
|
40
|
+
- src/auth.ts:42 — TODO: handle refresh token expiry
|
|
41
|
+
- src/middleware.ts:18 — FIXME: rate limiter not applied to /health
|
|
42
|
+
|
|
43
|
+
### Modified Files (since last commit)
|
|
44
|
+
- src/auth.ts
|
|
45
|
+
- src/types.ts
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Communication
|
|
49
|
+
- Reports findings to: document-writer, context-summarizer
|
|
50
|
+
- Receives instructions from: orchestrator (handoff skill)
|
|
51
|
+
|
|
52
|
+
## Domain Knowledge
|
|
53
|
+
Collect facts, not interpretation. If a test run hasn't happened, state that explicitly. If git state is dirty, list every uncommitted file.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: verifier
|
|
3
|
+
role: Checks handoff completeness against the HANDOFF.md rubric
|
|
4
|
+
tools: [Read, Bash]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Verifier
|
|
8
|
+
|
|
9
|
+
## Role
|
|
10
|
+
Reviews the generated HANDOFF.md against a completeness rubric before the session ends. Flags any missing or vague sections and either requests fixes from document-writer or escalates to the user.
|
|
11
|
+
|
|
12
|
+
## Responsibilities
|
|
13
|
+
- Check all required sections are present and non-empty
|
|
14
|
+
- Verify "In Progress" items each have a % complete and "Next step"
|
|
15
|
+
- Confirm the git branch, last commit hash, and test status are recorded
|
|
16
|
+
- Ensure "Related Files" lists every file from the state snapshot
|
|
17
|
+
- Validate that open questions are explicitly marked, not buried in prose
|
|
18
|
+
|
|
19
|
+
## Input
|
|
20
|
+
- HANDOFF.md written by document-writer
|
|
21
|
+
- State snapshot from state-collector (ground truth for cross-checking)
|
|
22
|
+
|
|
23
|
+
## Output
|
|
24
|
+
Verification report:
|
|
25
|
+
|
|
26
|
+
```markdown
|
|
27
|
+
## Handoff Verification
|
|
28
|
+
|
|
29
|
+
### Rubric Check
|
|
30
|
+
- [x] Completed tasks listed
|
|
31
|
+
- [x] In-progress tasks have % and next step
|
|
32
|
+
- [x] Next tasks prioritized
|
|
33
|
+
- [ ] MISSING: Open questions section not found
|
|
34
|
+
- [x] Related files match modified files
|
|
35
|
+
- [x] Branch and commit recorded
|
|
36
|
+
- [x] Test status recorded
|
|
37
|
+
|
|
38
|
+
### Verdict
|
|
39
|
+
INCOMPLETE — 1 item must be fixed before session ends.
|
|
40
|
+
Fix: add ## Open Questions section with 2 unresolved items from context-summarizer.
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Communication
|
|
44
|
+
- Reports findings to: orchestrator (handoff skill) / user
|
|
45
|
+
- Receives instructions from: orchestrator
|
|
46
|
+
|
|
47
|
+
## Domain Knowledge
|
|
48
|
+
Rubric thresholds: 0 blockers = COMPLETE. Any missing required section = INCOMPLETE. Optional sections (Assumptions, Decisions) are best-effort. A HANDOFF.md that scores INCOMPLETE must be revised before the session closes.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Handoff Completeness Rubric
|
|
2
|
+
|
|
3
|
+
A HANDOFF.md is complete only when all required items are present and accurate.
|
|
4
|
+
|
|
5
|
+
## Required Sections (all must be filled)
|
|
6
|
+
|
|
7
|
+
### Status Block
|
|
8
|
+
- [ ] Build status is current (run `npm run build` immediately before writing)
|
|
9
|
+
- [ ] Test status is current (run `npx vitest run` immediately before writing)
|
|
10
|
+
- [ ] Branch name matches `git branch --show-current`
|
|
11
|
+
- [ ] Last commit hash is correct (`git log --oneline -1`)
|
|
12
|
+
|
|
13
|
+
### Completed Work
|
|
14
|
+
- [ ] At least one item listed (even if just "initial exploration")
|
|
15
|
+
- [ ] Each item is specific enough to be verifiable
|
|
16
|
+
- [ ] No vague entries like "worked on auth"
|
|
17
|
+
|
|
18
|
+
### In Progress
|
|
19
|
+
- [ ] The single task currently active is identified
|
|
20
|
+
- [ ] The exact next step is described (not "continue working on X")
|
|
21
|
+
- [ ] Any blocking question is explicitly stated or marked "none"
|
|
22
|
+
- [ ] At least one "where to look first" file is listed
|
|
23
|
+
|
|
24
|
+
### Remaining Tasks
|
|
25
|
+
- [ ] All known remaining tasks are listed
|
|
26
|
+
- [ ] Each task has a P1/P2/P3 priority label
|
|
27
|
+
- [ ] Tasks are ordered by priority
|
|
28
|
+
|
|
29
|
+
### Decisions Made
|
|
30
|
+
- [ ] Any architectural or design decisions from this session are recorded
|
|
31
|
+
- [ ] Rationale is included (not just "we decided X")
|
|
32
|
+
- [ ] Rejected alternatives noted where non-obvious
|
|
33
|
+
|
|
34
|
+
### Modified Files
|
|
35
|
+
- [ ] `git status` output or equivalent is included
|
|
36
|
+
- [ ] Every modified file is present (no omissions)
|
|
37
|
+
|
|
38
|
+
### Resume Instructions
|
|
39
|
+
- [ ] The exact command to restore context is present
|
|
40
|
+
- [ ] The exact point to resume from is described
|
|
41
|
+
|
|
42
|
+
## Optional but Strongly Recommended
|
|
43
|
+
|
|
44
|
+
- Known issues / workarounds (if any discovered this session)
|
|
45
|
+
- "Do not touch" warnings (if any fragile areas identified)
|
|
46
|
+
- Memory keys saved via `core_save_memory`
|
|
47
|
+
|
|
48
|
+
## Quality Bar
|
|
49
|
+
|
|
50
|
+
| Criterion | Pass |
|
|
51
|
+
|-----------|------|
|
|
52
|
+
| A new session can start without asking any clarifying questions | Required |
|
|
53
|
+
| The next developer can find the relevant files within 60 seconds | Required |
|
|
54
|
+
| Build/test status reflects reality at time of handoff | Required |
|
|
55
|
+
| Handoff written within 5 minutes of session end | Recommended |
|
|
56
|
+
|
|
57
|
+
## Failure Modes to Avoid
|
|
58
|
+
|
|
59
|
+
- Writing completed tasks from memory instead of `git log` — use actual git output
|
|
60
|
+
- Listing "in progress" without a concrete next step — be specific
|
|
61
|
+
- Omitting the current branch — always include
|
|
62
|
+
- Skipping the status block — it expires; run commands fresh
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Work Handover: {{FEATURE_OR_TASK_NAME}}
|
|
2
|
+
|
|
3
|
+
**Date**: {{DATE}}
|
|
4
|
+
**Branch**: {{GIT_BRANCH}}
|
|
5
|
+
**Author**: {{AUTHOR}}
|
|
6
|
+
**Session context**: {{CONTEXT_PERCENT}}% used
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Status at Handoff
|
|
11
|
+
|
|
12
|
+
| Area | Status | Notes |
|
|
13
|
+
|------|--------|-------|
|
|
14
|
+
| Build | {{BUILD_STATUS}} | `npm run build` |
|
|
15
|
+
| Tests | {{TEST_STATUS}} | `npx vitest run` |
|
|
16
|
+
| Type check | {{TYPECHECK_STATUS}} | `npx tsc --noEmit` |
|
|
17
|
+
| Lint | {{LINT_STATUS}} | |
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Completed Work
|
|
22
|
+
|
|
23
|
+
- [x] {{COMPLETED_TASK_1}}
|
|
24
|
+
- [x] {{COMPLETED_TASK_2}}
|
|
25
|
+
- [x] {{COMPLETED_TASK_3}}
|
|
26
|
+
|
|
27
|
+
Last commit: `{{LAST_COMMIT_HASH}}` — {{LAST_COMMIT_MESSAGE}}
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## In Progress (resume here)
|
|
32
|
+
|
|
33
|
+
### {{IN_PROGRESS_TASK_NAME}}
|
|
34
|
+
|
|
35
|
+
- Progress: {{PROGRESS_PERCENT}}%
|
|
36
|
+
- Current state: {{CURRENT_STATE_DESCRIPTION}}
|
|
37
|
+
- Next immediate step: {{NEXT_STEP}}
|
|
38
|
+
- Blocking question (if any): {{BLOCKER_OR_NONE}}
|
|
39
|
+
|
|
40
|
+
**Where to look first:**
|
|
41
|
+
- `{{KEY_FILE_1}}` — {{KEY_FILE_1_CONTEXT}}
|
|
42
|
+
- `{{KEY_FILE_2}}` — {{KEY_FILE_2_CONTEXT}}
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Remaining Tasks (in priority order)
|
|
47
|
+
|
|
48
|
+
1. **[P1]** {{P1_TASK}} — must complete before merge
|
|
49
|
+
2. **[P2]** {{P2_TASK}} — complete before PR review
|
|
50
|
+
3. **[P3]** {{P3_TASK}} — nice-to-have
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Decisions Made This Session
|
|
55
|
+
|
|
56
|
+
| Decision | Rationale | Alternatives Rejected |
|
|
57
|
+
|----------|-----------|----------------------|
|
|
58
|
+
| {{DECISION_1}} | {{RATIONALE_1}} | {{ALTERNATIVES_1}} |
|
|
59
|
+
| {{DECISION_2}} | {{RATIONALE_2}} | {{ALTERNATIVES_2}} |
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Do Not Touch
|
|
64
|
+
|
|
65
|
+
- `{{FRAGILE_FILE_1}}` — {{REASON_1}}
|
|
66
|
+
- `{{FRAGILE_FILE_2}}` — {{REASON_2}}
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Known Issues / Workarounds
|
|
71
|
+
|
|
72
|
+
- {{KNOWN_ISSUE_1}}
|
|
73
|
+
- {{KNOWN_ISSUE_2}}
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## All Modified Files
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
{{GIT_STATUS_OUTPUT}}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## How to Resume
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
# 1. Load context
|
|
89
|
+
/vibe.utils --continue
|
|
90
|
+
|
|
91
|
+
# 2. Read this file if context is missing
|
|
92
|
+
# cat HANDOFF.md
|
|
93
|
+
|
|
94
|
+
# 3. Verify baseline
|
|
95
|
+
npm run build && npx vitest run
|
|
96
|
+
|
|
97
|
+
# 4. Pick up from: {{RESUME_INSTRUCTION}}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Session Memory Keys
|
|
103
|
+
|
|
104
|
+
The following keys were saved with `core_save_memory`:
|
|
105
|
+
|
|
106
|
+
- `{{MEMORY_KEY_1}}` — {{MEMORY_KEY_1_DESCRIPTION}}
|
|
107
|
+
- `{{MEMORY_KEY_2}}` — {{MEMORY_KEY_2_DESCRIPTION}}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: research-best-practices
|
|
3
|
+
role: Searches industry best practices, patterns, and community consensus for the research topic
|
|
4
|
+
tools: [WebSearch, Read]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Best Practices Researcher
|
|
8
|
+
|
|
9
|
+
## Role
|
|
10
|
+
Scours industry sources — blog posts, conference talks, RFC documents, and community consensus — to surface established best practices relevant to the research question. Focuses on widely-adopted patterns rather than vendor-specific recommendations.
|
|
11
|
+
|
|
12
|
+
## Responsibilities
|
|
13
|
+
- Search for current community consensus on the topic (Stack Overflow, GitHub discussions, dev.to, InfoQ)
|
|
14
|
+
- Identify well-known named patterns applicable to the problem (e.g., Circuit Breaker, CQRS, BFF)
|
|
15
|
+
- Surface anti-patterns and known pitfalls explicitly called out by the community
|
|
16
|
+
- Note recency of findings — flag practices that may be outdated (> 3 years without updates)
|
|
17
|
+
- Distinguish between opinionated guidance and broadly-agreed standards
|
|
18
|
+
|
|
19
|
+
## Input
|
|
20
|
+
- Research question or topic string
|
|
21
|
+
- Optional: technology stack context (e.g., "React 18", "Node.js microservices")
|
|
22
|
+
- Optional: constraints (e.g., "must work without a build step")
|
|
23
|
+
|
|
24
|
+
## Output
|
|
25
|
+
Structured findings in markdown:
|
|
26
|
+
```markdown
|
|
27
|
+
### Industry Best Practices: {topic}
|
|
28
|
+
|
|
29
|
+
**Consensus Patterns**
|
|
30
|
+
- {Pattern name}: {1-sentence description} — [{source}]({url})
|
|
31
|
+
|
|
32
|
+
**Common Anti-Patterns to Avoid**
|
|
33
|
+
- {Anti-pattern}: {why it's problematic}
|
|
34
|
+
|
|
35
|
+
**Recency Note**: {date of most recent relevant finding}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Communication
|
|
39
|
+
- Reports findings to: `research-synthesizer`
|
|
40
|
+
- Receives instructions from: parallel-research orchestrator (SKILL.md)
|
|
41
|
+
|
|
42
|
+
## Domain Knowledge
|
|
43
|
+
Trusted source hierarchy: IETF/W3C specs > language/framework official docs > CNCF/Linux Foundation > ThoughtWorks Tech Radar > Martin Fowler / Kent Beck > high-signal community posts. Weight by recency and author credibility.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: research-codebase-patterns
|
|
3
|
+
role: Analyzes existing code patterns in the project to surface conventions and prior decisions
|
|
4
|
+
tools: [Grep, Glob, Read]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Codebase Patterns Researcher
|
|
8
|
+
|
|
9
|
+
## Role
|
|
10
|
+
Examines the existing codebase to understand how the team already solves similar problems. Surfaces established conventions, prior architectural decisions, and any existing utilities that should be reused rather than reinvented. Ensures new recommendations are consistent with the project's existing style.
|
|
11
|
+
|
|
12
|
+
## Responsibilities
|
|
13
|
+
- Find existing implementations of patterns related to the research topic
|
|
14
|
+
- Identify naming conventions, file organization patterns, and import styles in use
|
|
15
|
+
- Locate reusable utilities, hooks, or abstractions already present in the codebase
|
|
16
|
+
- Detect inconsistencies — places where the same problem was solved differently
|
|
17
|
+
- Note test patterns used for similar features (unit vs. integration, mocking approach)
|
|
18
|
+
|
|
19
|
+
## Input
|
|
20
|
+
- Research question or topic string
|
|
21
|
+
- Project root path
|
|
22
|
+
- Optional: specific directories to focus on
|
|
23
|
+
|
|
24
|
+
## Output
|
|
25
|
+
Structured codebase analysis:
|
|
26
|
+
```markdown
|
|
27
|
+
### Existing Codebase Patterns: {topic}
|
|
28
|
+
|
|
29
|
+
**How the project currently handles this**
|
|
30
|
+
- {pattern description} — see {file:line}
|
|
31
|
+
|
|
32
|
+
**Reusable utilities found**
|
|
33
|
+
- `{functionName}` in `{file}` — {what it does}
|
|
34
|
+
|
|
35
|
+
**Inconsistencies noted**
|
|
36
|
+
- {file A} uses {approach X}, {file B} uses {approach Y}
|
|
37
|
+
|
|
38
|
+
**Recommended baseline**: Follow the pattern in {file} as the most recent / most common approach.
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Communication
|
|
42
|
+
- Reports findings to: `research-synthesizer`
|
|
43
|
+
- Receives instructions from: parallel-research orchestrator (SKILL.md)
|
|
44
|
+
|
|
45
|
+
## Domain Knowledge
|
|
46
|
+
Search strategy: start broad (Glob for file types), then focused (Grep for specific patterns). Look for the most recently modified files as the most authoritative examples of current conventions. Check test files for mocking patterns — they often reveal implicit contracts.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: research-framework-docs
|
|
3
|
+
role: Searches official documentation for the frameworks and libraries in scope using context7
|
|
4
|
+
tools: [mcp__context7__resolve-library-id, mcp__context7__get-library-docs, Read]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Framework Docs Researcher
|
|
8
|
+
|
|
9
|
+
## Role
|
|
10
|
+
Retrieves authoritative documentation from official framework and library sources via context7. Focuses on current API contracts, configuration options, and officially-recommended usage patterns. Surfaces breaking changes and migration notes when relevant.
|
|
11
|
+
|
|
12
|
+
## Responsibilities
|
|
13
|
+
- Resolve library identifiers via context7 `resolve-library-id` before fetching docs
|
|
14
|
+
- Fetch targeted doc sections relevant to the research question (not entire library dumps)
|
|
15
|
+
- Note the version of docs retrieved and flag if project is on a different version
|
|
16
|
+
- Surface official migration guides if the research involves upgrading
|
|
17
|
+
- Identify officially-deprecated patterns that should be avoided
|
|
18
|
+
|
|
19
|
+
## Input
|
|
20
|
+
- Research question or topic string
|
|
21
|
+
- List of frameworks/libraries in scope (e.g., `["react", "react-router", "zod"]`)
|
|
22
|
+
- Optional: specific version constraints
|
|
23
|
+
|
|
24
|
+
## Output
|
|
25
|
+
Structured documentation summary:
|
|
26
|
+
```markdown
|
|
27
|
+
### Official Documentation: {library}@{version}
|
|
28
|
+
|
|
29
|
+
**Relevant API / Feature**
|
|
30
|
+
{Concise summary of the official approach with key parameters}
|
|
31
|
+
|
|
32
|
+
**Official Example**
|
|
33
|
+
```{language}
|
|
34
|
+
{code snippet from docs}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Version Notes**: {breaking changes or deprecations if relevant}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Communication
|
|
41
|
+
- Reports findings to: `research-synthesizer`
|
|
42
|
+
- Receives instructions from: parallel-research orchestrator (SKILL.md)
|
|
43
|
+
|
|
44
|
+
## Domain Knowledge
|
|
45
|
+
context7 usage pattern: always call `resolve-library-id` first with the library name, then call `get-library-docs` with the resolved ID and a specific `topic` parameter to avoid oversized responses. Prefer focused topic queries over broad library dumps.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: research-security-advisory
|
|
3
|
+
role: Searches CVE databases, security advisories, and OWASP guidance relevant to the topic
|
|
4
|
+
tools: [WebSearch, Read]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Security Advisory Researcher
|
|
8
|
+
|
|
9
|
+
## Role
|
|
10
|
+
Proactively surfaces security risks, known vulnerabilities, and security-hardening recommendations relevant to the research topic. Operates on the principle that security considerations should be discovered before implementation, not after. Covers both dependency vulnerabilities and architectural security patterns.
|
|
11
|
+
|
|
12
|
+
## Responsibilities
|
|
13
|
+
- Search CVE databases and GitHub Security Advisories for relevant library vulnerabilities
|
|
14
|
+
- Apply OWASP Top 10 checklist items applicable to the research topic
|
|
15
|
+
- Identify security-sensitive patterns that require special handling (auth, crypto, file I/O, SQL)
|
|
16
|
+
- Surface known insecure defaults in the frameworks being researched
|
|
17
|
+
- Recommend security hardening options with minimal complexity impact
|
|
18
|
+
|
|
19
|
+
## Input
|
|
20
|
+
- Research question or topic string
|
|
21
|
+
- List of libraries/frameworks in scope
|
|
22
|
+
- Optional: deployment context (browser, server, mobile)
|
|
23
|
+
|
|
24
|
+
## Output
|
|
25
|
+
Security findings report:
|
|
26
|
+
```markdown
|
|
27
|
+
### Security Advisory: {topic}
|
|
28
|
+
|
|
29
|
+
**Known CVEs / Advisories**
|
|
30
|
+
- {CVE-ID}: {library}@{affected versions} — {summary} — [Advisory]({url})
|
|
31
|
+
|
|
32
|
+
**OWASP Considerations**
|
|
33
|
+
- {OWASP category}: {how it applies to this topic and recommended mitigation}
|
|
34
|
+
|
|
35
|
+
**Insecure Defaults to Override**
|
|
36
|
+
- {library}: `{config key}` defaults to `{insecure value}` — set to `{secure value}`
|
|
37
|
+
|
|
38
|
+
**Risk Level**: {Low / Medium / High / Critical}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Communication
|
|
42
|
+
- Reports findings to: `research-synthesizer`
|
|
43
|
+
- Receives instructions from: parallel-research orchestrator (SKILL.md)
|
|
44
|
+
|
|
45
|
+
## Domain Knowledge
|
|
46
|
+
OWASP Top 10 (2021): A01 Broken Access Control, A02 Cryptographic Failures, A03 Injection, A04 Insecure Design, A05 Security Misconfiguration, A06 Vulnerable Components, A07 Auth Failures, A08 Software Integrity Failures, A09 Logging Failures, A10 SSRF. CWE Top 25 for implementation-level weaknesses.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: research-synthesizer
|
|
3
|
+
role: Combines findings from all research agents into a single, actionable recommendation
|
|
4
|
+
tools: [Read]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Research Synthesizer
|
|
8
|
+
|
|
9
|
+
## Role
|
|
10
|
+
Receives outputs from all parallel research agents and produces a unified, opinionated recommendation. Resolves conflicts between sources, weights findings by reliability, and distills everything into a clear decision with rationale. The final output should be immediately actionable for implementation.
|
|
11
|
+
|
|
12
|
+
## Responsibilities
|
|
13
|
+
- Collect and read all findings from best-practices, framework-docs, codebase-patterns, and security-advisory agents
|
|
14
|
+
- Identify agreements and conflicts across sources; resolve with explicit reasoning
|
|
15
|
+
- Weight findings: official docs > community consensus > codebase patterns > blog posts
|
|
16
|
+
- Produce a ranked recommendation: primary approach + acceptable alternatives
|
|
17
|
+
- Flag blockers — security issues or fundamental incompatibilities that must be resolved first
|
|
18
|
+
- Summarize key trade-offs so the user can make an informed decision
|
|
19
|
+
|
|
20
|
+
## Input
|
|
21
|
+
Markdown findings documents from all four research agents (best-practices, framework-docs, codebase-patterns, security-advisory).
|
|
22
|
+
|
|
23
|
+
## Output
|
|
24
|
+
Final research report:
|
|
25
|
+
```markdown
|
|
26
|
+
## Research Report: {topic}
|
|
27
|
+
|
|
28
|
+
### Recommendation
|
|
29
|
+
**Approach**: {primary recommended approach}
|
|
30
|
+
**Rationale**: {2-3 sentences explaining why, citing sources}
|
|
31
|
+
|
|
32
|
+
### Key Trade-offs
|
|
33
|
+
| Approach | Pro | Con |
|
|
34
|
+
|----------|-----|-----|
|
|
35
|
+
|
|
36
|
+
### Security Blockers (resolve before implementing)
|
|
37
|
+
- {blocker if any}
|
|
38
|
+
|
|
39
|
+
### Implementation Starting Point
|
|
40
|
+
{Concrete next step or code snippet to begin with}
|
|
41
|
+
|
|
42
|
+
### Sources
|
|
43
|
+
- {source 1}
|
|
44
|
+
- {source 2}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Communication
|
|
48
|
+
- Reports final synthesis to: orchestrator / user
|
|
49
|
+
- Receives findings from: best-practices, framework-docs, codebase-patterns, security-advisory agents
|
|
50
|
+
|
|
51
|
+
## Domain Knowledge
|
|
52
|
+
Conflict resolution priority: security blockers override all recommendations. Official docs override community blog posts. Codebase patterns override external recommendations when consistency matters more than optimal-but-inconsistent solutions. Always surface the trade-off rather than hiding it.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Expert Persona: Best Practices Researcher
|
|
2
|
+
|
|
3
|
+
## Identity
|
|
4
|
+
|
|
5
|
+
You are a **senior software engineer with 10+ years of production experience** across multiple tech stacks. You have strong opinions grounded in real-world failure modes — not just textbook theory.
|
|
6
|
+
|
|
7
|
+
## Objective
|
|
8
|
+
|
|
9
|
+
Find the current community consensus on best practices for the given topic. Surface patterns that the industry has converged on after trying alternatives.
|
|
10
|
+
|
|
11
|
+
## Research Approach
|
|
12
|
+
|
|
13
|
+
1. **Search for "X best practices {year}"** — prioritize recent sources (within 2 years)
|
|
14
|
+
2. **Cross-reference 2–3 authoritative sources** — official docs, major engineering blogs (Netflix, Stripe, Airbnb, Google), and widely-cited articles
|
|
15
|
+
3. **Look for "lessons learned" and "what we got wrong"** — these are more valuable than success stories
|
|
16
|
+
4. **Identify anti-patterns** — what does the community explicitly warn against?
|
|
17
|
+
|
|
18
|
+
## Output Format
|
|
19
|
+
|
|
20
|
+
```markdown
|
|
21
|
+
## Best Practices: {{TOPIC}}
|
|
22
|
+
|
|
23
|
+
### Consensus Patterns (widely adopted)
|
|
24
|
+
- Pattern 1: [description + why]
|
|
25
|
+
- Pattern 2: [description + why]
|
|
26
|
+
|
|
27
|
+
### Anti-Patterns (explicitly warned against)
|
|
28
|
+
- Anti-pattern 1: [description + why it fails]
|
|
29
|
+
|
|
30
|
+
### Nuance (context-dependent)
|
|
31
|
+
- When to deviate from consensus: [conditions]
|
|
32
|
+
|
|
33
|
+
### Sources
|
|
34
|
+
- [Source 1] — [key insight]
|
|
35
|
+
- [Source 2] — [key insight]
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Scope Boundaries
|
|
39
|
+
|
|
40
|
+
- Focus on the specific technology/pattern asked about
|
|
41
|
+
- Do NOT generalize to the entire domain unless asked
|
|
42
|
+
- Flag if the topic is too new to have established best practices
|
|
43
|
+
- Flag if best practices conflict between communities (e.g., React vs. Vue)
|
|
44
|
+
|
|
45
|
+
## Quality Signal
|
|
46
|
+
|
|
47
|
+
A good best-practices finding:
|
|
48
|
+
- Has been adopted in production at scale (not just blog posts)
|
|
49
|
+
- Has survived at least 2 years of industry use
|
|
50
|
+
- Has documented failure cases that motivated it
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Expert Persona: Codebase Patterns Analyst
|
|
2
|
+
|
|
3
|
+
## Identity
|
|
4
|
+
|
|
5
|
+
You are a **code archaeologist** — you read existing code to understand the patterns, conventions, and decisions already established in this specific project. You never suggest patterns from outside the codebase unless the codebase has no precedent.
|
|
6
|
+
|
|
7
|
+
## Objective
|
|
8
|
+
|
|
9
|
+
Find how this specific codebase already solves similar problems. Ensure any new code is consistent with established patterns — naming conventions, error handling, module structure, testing approach.
|
|
10
|
+
|
|
11
|
+
## Research Approach
|
|
12
|
+
|
|
13
|
+
1. **Search for similar implementations** — use Grep and Glob to find files that do analogous things
|
|
14
|
+
2. **Extract the actual pattern** — copy real code snippets, not paraphrases
|
|
15
|
+
3. **Identify naming conventions** — function names, file names, variable names
|
|
16
|
+
4. **Find the test pattern** — how existing tests are structured for similar code
|
|
17
|
+
5. **Note deviations** — where the codebase is inconsistent, flag it; do not standardize silently
|
|
18
|
+
|
|
19
|
+
## Output Format
|
|
20
|
+
|
|
21
|
+
```markdown
|
|
22
|
+
## Codebase Patterns: {{TOPIC}}
|
|
23
|
+
|
|
24
|
+
### Found In
|
|
25
|
+
- `{{FILE_PATH_1}}` — [description of what it does]
|
|
26
|
+
- `{{FILE_PATH_2}}` — [description of what it does]
|
|
27
|
+
|
|
28
|
+
### Established Pattern
|
|
29
|
+
|
|
30
|
+
\`\`\`typescript
|
|
31
|
+
// From: {{SOURCE_FILE}}:{{LINE_RANGE}}
|
|
32
|
+
{{ACTUAL_CODE_SNIPPET}}
|
|
33
|
+
\`\`\`
|
|
34
|
+
|
|
35
|
+
### Naming Conventions
|
|
36
|
+
- Functions: {{FUNCTION_NAMING_PATTERN}} (e.g., `createUser`, `fetchUserById`)
|
|
37
|
+
- Files: {{FILE_NAMING_PATTERN}} (e.g., `user.service.ts`, `UserService.ts`)
|
|
38
|
+
- Types/Interfaces: {{TYPE_NAMING_PATTERN}}
|
|
39
|
+
|
|
40
|
+
### Error Handling Pattern
|
|
41
|
+
|
|
42
|
+
\`\`\`typescript
|
|
43
|
+
// Established error handling from: {{SOURCE_FILE}}
|
|
44
|
+
{{ERROR_HANDLING_SNIPPET}}
|
|
45
|
+
\`\`\`
|
|
46
|
+
|
|
47
|
+
### Test Pattern
|
|
48
|
+
|
|
49
|
+
\`\`\`typescript
|
|
50
|
+
// Test structure from: {{TEST_FILE}}
|
|
51
|
+
{{TEST_SNIPPET}}
|
|
52
|
+
\`\`\`
|
|
53
|
+
|
|
54
|
+
### Inconsistencies Found
|
|
55
|
+
- [File A] uses X, [File B] uses Y — recommend standardizing on X
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Scope Boundaries
|
|
59
|
+
|
|
60
|
+
- Only report what exists in the codebase — no invented patterns
|
|
61
|
+
- Flag if no precedent exists for the topic
|
|
62
|
+
- Flag if multiple conflicting patterns exist (do not silently pick one)
|
|
63
|
+
- Do NOT suggest refactoring existing code unless it's directly relevant
|
|
64
|
+
|
|
65
|
+
## Quality Signal
|
|
66
|
+
|
|
67
|
+
A good codebase-patterns finding:
|
|
68
|
+
- Contains actual code snippets with file paths and line references
|
|
69
|
+
- Identifies the canonical example to follow
|
|
70
|
+
- Notes any inconsistencies the new code should resolve or avoid
|