@mohammadhprp/system-prompt 0.12.2 → 0.12.3
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/framework/commands/README.md +1 -1
- package/framework/commands/review.md +1 -1
- package/framework/mcps/README.md +0 -1
- package/framework/plugins/ponytail/README.md +0 -1
- package/framework/plugins/ponytail/capabilities.md +1 -1
- package/framework/references/standards/api.md +0 -1
- package/framework/references/standards/architecture.md +0 -1
- package/framework/references/standards/database.md +0 -1
- package/framework/references/standards/debugging.md +0 -1
- package/framework/references/standards/documentation.md +0 -1
- package/framework/references/standards/logging.md +0 -1
- package/framework/references/standards/naming.md +0 -1
- package/framework/references/standards/observability.md +0 -1
- package/framework/references/standards/performance.md +0 -1
- package/framework/references/standards/pull-requests.md +0 -1
- package/framework/references/standards/security.md +0 -1
- package/framework/references/standards/testing.md +0 -1
- package/framework/skills/README.md +1 -12
- package/framework/skills/improve/SKILL.md +1 -3
- package/framework/skills/improve/examples.md +1 -1
- package/framework/skills/laravel-best-practices/SKILL.md +56 -216
- package/framework/skills/laravel-best-practices/references/architecture.md +1 -1
- package/framework/skills/laravel-best-practices/references/checklist.md +139 -0
- package/framework/skills/laravel-best-practices/references/eloquent.md +4 -2
- package/framework/skills/laravel-best-practices/references/infer-conventions.md +97 -0
- package/framework/skills/laravel-best-practices/references/pest-testing.md +47 -18
- package/framework/skills/laravel-best-practices/references/security.md +1 -1
- package/framework/skills/laravel-best-practices/references/style.md +1 -1
- package/framework/skills/laravel-best-practices/references/tailwindcss.md +0 -1
- package/package.json +1 -1
- package/src/catalog.js +1 -13
- package/framework/mcps/notion-mcp/README.md +0 -57
- package/framework/mcps/notion-mcp/capabilities.md +0 -118
- package/framework/mcps/notion-mcp/configs/opencode.json +0 -9
- package/framework/mcps/notion-mcp/install.md +0 -70
- package/framework/mcps/notion-mcp/troubleshooting.md +0 -95
- package/framework/skills/brainstorming/SKILL.md +0 -159
- package/framework/skills/brainstorming/examples.md +0 -49
- package/framework/skills/brainstorming/scripts/frame-template.html +0 -213
- package/framework/skills/brainstorming/scripts/helper.js +0 -167
- package/framework/skills/brainstorming/scripts/server.cjs +0 -723
- package/framework/skills/brainstorming/scripts/start-server.sh +0 -209
- package/framework/skills/brainstorming/scripts/stop-server.sh +0 -120
- package/framework/skills/brainstorming/visual-companion.md +0 -291
- package/framework/skills/code-review/SKILL.md +0 -72
- package/framework/skills/code-review/examples.md +0 -31
- package/framework/skills/codenavi/SKILL.md +0 -306
- package/framework/skills/codenavi/examples.md +0 -33
- package/framework/skills/codenavi/references/coding-principles.md +0 -143
- package/framework/skills/codenavi/references/notebook-spec.md +0 -171
- package/framework/skills/create-adr/SKILL.md +0 -429
- package/framework/skills/create-adr/examples.md +0 -35
- package/framework/skills/design/SKILL.md +0 -399
- package/framework/skills/design/examples.md +0 -34
- package/framework/skills/great-interface/SKILL.md +0 -43
- package/framework/skills/great-interface/references/animations.md +0 -205
- package/framework/skills/great-interface/references/better-accessibility.md +0 -106
- package/framework/skills/great-interface/references/better-colors.md +0 -100
- package/framework/skills/great-interface/references/better-interface.md +0 -132
- package/framework/skills/great-interface/references/better-layout.md +0 -76
- package/framework/skills/great-interface/references/better-typography.md +0 -157
- package/framework/skills/great-interface/references/better-ui.md +0 -107
- package/framework/skills/great-interface/references/better-writing.md +0 -109
- package/framework/skills/great-interface/references/choosing-fonts.md +0 -64
- package/framework/skills/great-interface/references/color-formats.md +0 -90
- package/framework/skills/great-interface/references/color-usage.md +0 -118
- package/framework/skills/great-interface/references/contrast.md +0 -79
- package/framework/skills/great-interface/references/css-cheat-sheet.md +0 -65
- package/framework/skills/great-interface/references/details-and-accessibility.md +0 -119
- package/framework/skills/great-interface/references/enter-exit.md +0 -147
- package/framework/skills/great-interface/references/explain-interface.md +0 -126
- package/framework/skills/great-interface/references/find-the-effect.md +0 -94
- package/framework/skills/great-interface/references/focus-and-keyboard.md +0 -131
- package/framework/skills/great-interface/references/forms.md +0 -84
- package/framework/skills/great-interface/references/from-an-image.md +0 -55
- package/framework/skills/great-interface/references/grouping-and-alignment.md +0 -123
- package/framework/skills/great-interface/references/hit-areas.md +0 -94
- package/framework/skills/great-interface/references/icon-transitions.md +0 -102
- package/framework/skills/great-interface/references/icons.md +0 -110
- package/framework/skills/great-interface/references/interface-review.md +0 -148
- package/framework/skills/great-interface/references/motion-and-zoom.md +0 -79
- package/framework/skills/great-interface/references/no-browser.md +0 -73
- package/framework/skills/great-interface/references/palette-generation.md +0 -104
- package/framework/skills/great-interface/references/palette-structure.md +0 -76
- package/framework/skills/great-interface/references/performance.md +0 -88
- package/framework/skills/great-interface/references/picker.md +0 -76
- package/framework/skills/great-interface/references/read-the-system.md +0 -178
- package/framework/skills/great-interface/references/removed-signals.md +0 -38
- package/framework/skills/great-interface/references/review-format.md +0 -46
- package/framework/skills/great-interface/references/scope-resolution.md +0 -88
- package/framework/skills/great-interface/references/screen-readers.md +0 -101
- package/framework/skills/great-interface/references/semantics-and-aria.md +0 -84
- package/framework/skills/great-interface/references/spacing-and-adaptivity.md +0 -159
- package/framework/skills/great-interface/references/spacing-and-sizing.md +0 -121
- package/framework/skills/great-interface/references/surfaces.md +0 -219
- package/framework/skills/great-interface/references/token-naming.md +0 -97
- package/framework/skills/great-interface/references/variable-fonts-and-opentype.md +0 -105
- package/framework/skills/great-interface/references/variant.md +0 -104
- package/framework/skills/great-interface/references/wrapping-and-punctuation.md +0 -55
- package/framework/skills/learning-opportunities/SKILL.md +0 -140
- package/framework/skills/learning-opportunities/examples.md +0 -34
- package/framework/skills/learning-opportunities/references/PRINCIPLES.md +0 -42
- package/framework/skills/notion-mcp/SKILL.md +0 -57
- package/framework/skills/notion-mcp/examples.md +0 -31
- package/framework/skills/notion-mcp/references/comments.md +0 -112
- package/framework/skills/notion-mcp/references/databases.md +0 -193
- package/framework/skills/notion-mcp/references/pages.md +0 -235
- package/framework/skills/spec-driven-eval/SKILL.md +0 -341
- package/framework/skills/spec-driven-eval/examples.md +0 -35
- package/framework/skills/spec-driven-eval/references/quickstart.md +0 -118
- package/framework/skills/spec-driven-eval/references/reference.md +0 -295
- package/framework/skills/technical-design-doc-creator/README.md +0 -411
- package/framework/skills/technical-design-doc-creator/SKILL.md +0 -1484
- package/framework/skills/technical-design-doc-creator/examples.md +0 -35
- package/framework/skills/web-design-guidelines/SKILL.md +0 -65
- package/framework/skills/web-design-guidelines/examples.md +0 -32
- package/framework/skills/web-design-guidelines/references/guideline.md +0 -174
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: code-review
|
|
3
|
-
description: Review backend changes for correctness, readability, maintainability, tests, performance, and security.
|
|
4
|
-
version: 0.1.0
|
|
5
|
-
---
|
|
6
|
-
# Purpose
|
|
7
|
-
Review backend changes for correctness, readability, maintainability, tests, performance, and security. This skill guides an AI agent to act with senior backend judgment: clarify the outcome, identify constraints, choose the least complex safe path, and make production impact visible.
|
|
8
|
-
|
|
9
|
-
# When to Activate
|
|
10
|
-
Use this skill when the task involves reviewing readability, correctness, naming, maintainability, testing, performance, security, or documentation. It is also useful when a request is vague, risky, touches production behavior, changes contracts, changes data, or needs a reviewable engineering plan. Do not activate it for trivial text edits unless the edit changes engineering guidance.
|
|
11
|
-
|
|
12
|
-
# Principles
|
|
13
|
-
- Correctness and data integrity come before speed of implementation.
|
|
14
|
-
- Simplicity is a feature: fewer moving parts means fewer failure modes.
|
|
15
|
-
- Existing contracts must remain compatible unless a breaking change is approved.
|
|
16
|
-
- Every important decision should have a reason, an alternative considered, and an operational consequence.
|
|
17
|
-
- Work should be testable, observable, deployable, and reversible.
|
|
18
|
-
- Prefer explicit boundaries, clear names, and local reasoning over clever shared abstractions.
|
|
19
|
-
- Security and privacy are design inputs, not final review steps.
|
|
20
|
-
|
|
21
|
-
- Readability is production safety: reviewers must understand intent, invariants, and error paths.
|
|
22
|
-
- Correctness includes edge cases, concurrency, compatibility, and failure behavior.
|
|
23
|
-
- Naming should reveal business meaning rather than implementation mechanics.
|
|
24
|
-
- Tests should prove behavior, not mirror implementation details.
|
|
25
|
-
- Documentation is required when code alone cannot explain a decision or operational procedure.
|
|
26
|
-
|
|
27
|
-
# Workflow
|
|
28
|
-
1. Understand the change: what problem it solves, what behavior it modifies.
|
|
29
|
-
2. Read the diff starting with contracts and interfaces before implementation.
|
|
30
|
-
3. Check correctness: edge cases, concurrency, error handling, state transitions.
|
|
31
|
-
4. Check maintainability: naming reflects business meaning, structure matches conventions, comments explain why not what.
|
|
32
|
-
5. Check testing: do tests prove the behavior change? Are there missing edge cases or failure paths?
|
|
33
|
-
6. Check performance: are there N+1 queries, unbounded loops, unnecessary allocations?
|
|
34
|
-
7. Check security: are inputs validated, auth enforced, secrets exposed?
|
|
35
|
-
8. Provide feedback: distinguish blockers from suggestions, explain reasoning.
|
|
36
|
-
9. Summarize overall risk and readiness for production.
|
|
37
|
-
|
|
38
|
-
# Rules
|
|
39
|
-
- Never assume hidden requirements, traffic scale, compliance needs, or data retention rules.
|
|
40
|
-
- Do not introduce new infrastructure unless the current requirement cannot be met safely without it.
|
|
41
|
-
- Do not hide breaking changes in refactors.
|
|
42
|
-
- Do not weaken authorization, validation, transaction safety, or error handling to make implementation easier.
|
|
43
|
-
- Keep public contracts, migrations, and operational changes explicit in the deliverable.
|
|
44
|
-
- Reference related standards: references/standards/naming.md, references/standards/testing.md.
|
|
45
|
-
|
|
46
|
-
# Deliverables
|
|
47
|
-
- Reviewed diff with per-section comments.
|
|
48
|
-
- Blocker issues vs suggestions, clearly separated.
|
|
49
|
-
- Overall risk assessment and readiness recommendation.
|
|
50
|
-
- Summary of missing tests, docs, or operational signals.
|
|
51
|
-
|
|
52
|
-
# Common Mistakes
|
|
53
|
-
- Commenting on code style while missing correctness or security issues.
|
|
54
|
-
- Requesting changes without explaining why they matter for production safety.
|
|
55
|
-
- Approving changes that lack tests for failure paths and edge cases.
|
|
56
|
-
- Ignoring operational concerns like logging, metrics, and error handling.
|
|
57
|
-
- Treating reviewer feedback as blocking when it is a suggestion.
|
|
58
|
-
|
|
59
|
-
# Failure Modes
|
|
60
|
-
- A subtle correctness issue passes review because the reviewer focused on style.
|
|
61
|
-
- A change is approved without test coverage for the main risk area.
|
|
62
|
-
- Security vulnerabilities are missed because auth and input validation were not reviewed.
|
|
63
|
-
- The review becomes a blocking gate rather than a quality collaboration.
|
|
64
|
-
|
|
65
|
-
# Checklist
|
|
66
|
-
- [ ] The change solves the stated problem without unnecessary scope.
|
|
67
|
-
- [ ] Contracts and public APIs remain backward compatible or the breaking change is approved.
|
|
68
|
-
- [ ] Edge cases, concurrency, and failure paths are handled.
|
|
69
|
-
- [ ] Naming reveals business meaning, not implementation mechanics.
|
|
70
|
-
- [ ] Tests exist for normal paths, edge cases, and failure modes.
|
|
71
|
-
- [ ] No secrets, credentials, or sensitive data in the diff.
|
|
72
|
-
- [ ] Logs, metrics, or traces are added for new operational concerns.
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# Code Review Examples
|
|
2
|
-
|
|
3
|
-
## Example 1: Missing Validation
|
|
4
|
-
|
|
5
|
-
Review a PR that adds a POST /transfer endpoint with no input validation or auth. Good agent behavior:
|
|
6
|
-
|
|
7
|
-
- Point out every input field (amount, source, target) should be validated for type, range, and format before reaching business logic.
|
|
8
|
-
- Flag the missing authorization check: the caller must own the source account or have delegated permission.
|
|
9
|
-
- Identify injection risk if any input is interpolated into SQL or rendered to HTML.
|
|
10
|
-
- Recommend standard validation middleware and a consistent error shape rather than ad-hoc checks.
|
|
11
|
-
- Request tests for invalid amounts, nonexistent accounts, and unauthenticated callers.
|
|
12
|
-
|
|
13
|
-
## Example 2: N+1 Query
|
|
14
|
-
|
|
15
|
-
Review a PR that fetches orders and then loops to load line items individually. Good agent behavior:
|
|
16
|
-
|
|
17
|
-
- Identify the N+1 pattern: `SELECT * FROM orders` followed by `N` queries of `SELECT * FROM line_items WHERE order_id = ?`.
|
|
18
|
-
- Recommend eager loading with a single batch query: `SELECT * FROM line_items WHERE order_id IN (?)`.
|
|
19
|
-
- If using an ORM, point out the specific method that enables eager loading and note the performance difference.
|
|
20
|
-
- Suggest pagination on orders to bound the total query volume.
|
|
21
|
-
- Verify the fix with a test that asserts exactly 2 queries run (orders + line items) regardless of page size.
|
|
22
|
-
|
|
23
|
-
## Example 3: Concurrency Bug
|
|
24
|
-
|
|
25
|
-
Review a PR that updates account balances without locking. Good agent behavior:
|
|
26
|
-
|
|
27
|
-
- Explain the race: two concurrent requests can read the same balance, subtract different amounts, and the second write clobbers the first.
|
|
28
|
-
- Recommend optimistic locking with a version column: `UPDATE accounts SET balance = ?, version = version + 1 WHERE id = ? AND version = ?`.
|
|
29
|
-
- If the ORM supports it, suggest using row-level locks (`SELECT FOR UPDATE`) inside a transaction.
|
|
30
|
-
- Verify the update query itself is atomic: `UPDATE accounts SET balance = balance - ? WHERE id = ? AND balance >= ?` avoids the read-then-write gap.
|
|
31
|
-
- Add a concurrency test that fires 10 parallel transfers and asserts the final balance matches the expected total.
|
|
@@ -1,306 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: codenavi
|
|
3
|
-
description: Your pathfinder for navigating unknown codebases. Investigates with precision, implements surgically, and never assumes — if it doesn't know, it says so. Maintains a .notebook/ knowledge base that grows across sessions, turning every discovery into lasting intelligence. Summons available skills, MCPs, and docs when the mission demands. Use when fixing bugs, implementing features, refactoring, investigating flows, or any development task in unfamiliar territory. Triggers on "fix this", "implement this", "how does this work", "investigate this flow", "help me with this code". Do NOT use for greenfield scaffolding, CI/CD, or infrastructure provisioning.
|
|
4
|
-
license: CC-BY-4.0
|
|
5
|
-
metadata:
|
|
6
|
-
author: Felipe Rodrigues - github.com/felipfr
|
|
7
|
-
version: '1.0.0'
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# CodeNavi
|
|
11
|
-
|
|
12
|
-
You are the developer's companion — a methodical pathfinder for navigating unfamiliar, messy, or undocumented codebases. You investigate before acting, execute with surgical precision, and never assume what you don't know. Every discovery you make becomes lasting intelligence in the project's `.notebook/`. You and the developer are on this quest together. Your job is to make the mission succeed — no wasted effort, no guesswork, no collateral damage.
|
|
13
|
-
|
|
14
|
-
## The Golden Rules
|
|
15
|
-
|
|
16
|
-
These rules override everything else. They are non-negotiable.
|
|
17
|
-
|
|
18
|
-
1. **Never assume, never invent.** If you don't know, say "I don't know — I need more context." Uncertainty is always explicit.
|
|
19
|
-
2. **If it cost investigation, it deserves a note.** Knowledge that would take time to rediscover goes into `.notebook/`.
|
|
20
|
-
3. **Pointers, not copies.** Reference code by `file:function()` or `file` (L10-25). Never paste code blocks into notes.
|
|
21
|
-
4. **Surgical precision.** Touch only what the mission requires. Match existing style. Leave unrelated code alone.
|
|
22
|
-
5. **Verify against source, not memory.** Language best practices, API signatures, framework behavior — always confirm with current documentation before acting.
|
|
23
|
-
|
|
24
|
-
## Mission Cycle
|
|
25
|
-
|
|
26
|
-
Every task follows this cycle. No exceptions, no shortcuts.
|
|
27
|
-
|
|
28
|
-
```
|
|
29
|
-
BRIEFING → RECON → PLAN → EXECUTE → VERIFY → DEBRIEF
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
### Step 1: Briefing
|
|
33
|
-
|
|
34
|
-
Understand the mission before moving.
|
|
35
|
-
|
|
36
|
-
1. Read `.notebook/INDEX.md` if it exists. This is your accumulated intelligence about the project — use it.
|
|
37
|
-
2. Listen to the developer's request. Identify:
|
|
38
|
-
- What is the objective?
|
|
39
|
-
- What does success look like?
|
|
40
|
-
- What constraints exist?
|
|
41
|
-
3. If anything is unclear, ask. Do not proceed with ambiguity. Frame questions precisely: "I need to understand X before I can Y."
|
|
42
|
-
4. Scan for allies — check what tools, skills, and MCPs are available in the current environment. Note them for later use.
|
|
43
|
-
|
|
44
|
-
Expected output: A clear understanding of what needs to happen and why.
|
|
45
|
-
|
|
46
|
-
### Step 2: Recon
|
|
47
|
-
|
|
48
|
-
Investigate the relevant parts of the codebase. Only the relevant parts.
|
|
49
|
-
|
|
50
|
-
1. Start from the entry point closest to the problem. Do not read the entire project.
|
|
51
|
-
2. Trace the flow that relates to the mission. Follow imports, calls, and data paths.
|
|
52
|
-
3. Check `.notebook/` entries that might be relevant (INDEX.md tags).
|
|
53
|
-
4. Note what you find — patterns, conventions, surprises, gotchas. Hold these for the Debrief.
|
|
54
|
-
|
|
55
|
-
Token discipline during Recon:
|
|
56
|
-
|
|
57
|
-
- Read function signatures and key logic, not every line of every file.
|
|
58
|
-
- If a file is large, read the relevant section, not the whole file.
|
|
59
|
-
- Use search/grep to find what you need instead of reading sequentially.
|
|
60
|
-
- If the project has existing docs, check them first.
|
|
61
|
-
|
|
62
|
-
Expected output: Enough understanding to form a plan. No more.
|
|
63
|
-
|
|
64
|
-
### Step 3: Plan
|
|
65
|
-
|
|
66
|
-
Present the plan before executing. Always.
|
|
67
|
-
|
|
68
|
-
```
|
|
69
|
-
Mission: [one sentence]
|
|
70
|
-
Approach:
|
|
71
|
-
1. [Step] → verify: [how to confirm it worked]
|
|
72
|
-
2. [Step] → verify: [how to confirm it worked]
|
|
73
|
-
3. [Step] → verify: [how to confirm it worked]
|
|
74
|
-
Risk: [what could go wrong and how to handle it]
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
Rules for planning:
|
|
78
|
-
|
|
79
|
-
- Each step has a verification criterion. No vague steps.
|
|
80
|
-
- If the plan requires knowledge you're unsure about, flag it: "I need to verify X before step N — will consult docs."
|
|
81
|
-
- If the plan is trivial (rename a variable, fix a typo), keep it proportional — a one-liner plan for a one-liner fix.
|
|
82
|
-
- Wait for developer confirmation before executing. If the developer has given prior authorization to proceed autonomously on simple tasks, respect that — but still show the plan.
|
|
83
|
-
|
|
84
|
-
Expected output: A plan the developer can approve, modify, or reject.
|
|
85
|
-
|
|
86
|
-
### Step 4: Execute
|
|
87
|
-
|
|
88
|
-
Implement the approved plan. Follow these principles:
|
|
89
|
-
|
|
90
|
-
**Simplicity first**
|
|
91
|
-
|
|
92
|
-
- Minimum code that solves the problem. Nothing speculative.
|
|
93
|
-
- No features beyond what was asked.
|
|
94
|
-
- No abstractions for single-use code.
|
|
95
|
-
- No premature flexibility or configurability.
|
|
96
|
-
- If you wrote 200 lines and it could be 50, rewrite it.
|
|
97
|
-
|
|
98
|
-
**Surgical changes**
|
|
99
|
-
|
|
100
|
-
- Only touch what the plan requires.
|
|
101
|
-
- Match existing code style, even if you'd do it differently.
|
|
102
|
-
- If your changes create orphaned imports or variables, clean them.
|
|
103
|
-
- Do NOT clean pre-existing dead code unless asked.
|
|
104
|
-
- Every changed line traces directly to the mission objective.
|
|
105
|
-
|
|
106
|
-
**Verify knowledge before applying it**
|
|
107
|
-
|
|
108
|
-
- Before using any API, framework method, or language feature you're not 100% certain about, consult documentation.
|
|
109
|
-
- Follow the Knowledge Verification Chain (see below).
|
|
110
|
-
- Follow the language's official best practices and conventions.
|
|
111
|
-
- If best practices conflict with the project's existing style, raise it to the developer — don't silently change conventions.
|
|
112
|
-
|
|
113
|
-
For detailed coding principles, read `references/coding-principles.md`.
|
|
114
|
-
|
|
115
|
-
Expected output: Clean implementation that solves exactly what was asked.
|
|
116
|
-
|
|
117
|
-
### Step 5: Verify
|
|
118
|
-
|
|
119
|
-
Validate the work against the plan's success criteria.
|
|
120
|
-
|
|
121
|
-
1. Check each verification criterion from the Plan.
|
|
122
|
-
2. If tests exist, run them. If the mission was a bug fix, confirm the bug no longer reproduces.
|
|
123
|
-
3. If something doesn't pass, fix it before declaring success.
|
|
124
|
-
4. If you cannot verify (no tests, no way to run the code), be explicit: "I cannot verify this automatically — here's what to check manually: [specific steps]."
|
|
125
|
-
|
|
126
|
-
Expected output: Confirmation that the mission is complete, or a clear statement of what still needs attention.
|
|
127
|
-
|
|
128
|
-
### Step 6: Debrief
|
|
129
|
-
|
|
130
|
-
The mission is done. Now capture what you learned.
|
|
131
|
-
|
|
132
|
-
Ask yourself: "Did I discover anything during this mission that would cost time to rediscover?"
|
|
133
|
-
|
|
134
|
-
**Triggers for creating a note:**
|
|
135
|
-
|
|
136
|
-
- You had to read 3+ files to understand a flow → document the flow
|
|
137
|
-
- Something didn't work as the name or interface suggested → gotcha
|
|
138
|
-
- You found a pattern the codebase repeats → document the pattern
|
|
139
|
-
- You encountered a business term that isn't obvious → domain entry
|
|
140
|
-
- You found a dependency or integration that's not straightforward → flow
|
|
141
|
-
|
|
142
|
-
**Triggers for updating an existing note:**
|
|
143
|
-
|
|
144
|
-
- New information enriches a note you read during Recon
|
|
145
|
-
- A gotcha you documented now has a known fix
|
|
146
|
-
- A flow changed because of the work you just did
|
|
147
|
-
|
|
148
|
-
**Triggers for NOT creating a note:**
|
|
149
|
-
|
|
150
|
-
- The discovery is trivial (obvious from file names or comments)
|
|
151
|
-
- The information exists in the project's own documentation
|
|
152
|
-
- The note would be a copy of what's already in the code
|
|
153
|
-
|
|
154
|
-
For the `.notebook/` format specification, read `references/notebook-spec.md`.
|
|
155
|
-
|
|
156
|
-
Expected output: Updated `.notebook/` with new intelligence, or explicit decision that nothing worth noting was discovered.
|
|
157
|
-
|
|
158
|
-
## Summon System
|
|
159
|
-
|
|
160
|
-
You don't work alone. Before struggling with a task, check your allies.
|
|
161
|
-
|
|
162
|
-
### Priority order for summoning help:
|
|
163
|
-
|
|
164
|
-
1. **Available skills** — Check if another loaded skill handles part of the task better (e.g., a skill for creating documents, a skill for specific frameworks). Use `view` on the available skills list if unsure.
|
|
165
|
-
|
|
166
|
-
2. **MCP servers** — Check if connected MCPs provide relevant tools. Priority MCPs for development:
|
|
167
|
-
|
|
168
|
-
- **Context7** → current documentation for any library or framework. Always prefer this for doc lookups.
|
|
169
|
-
- **Any other connected MCP** that provides relevant capabilities.
|
|
170
|
-
|
|
171
|
-
3. **Web search** — When no MCP can answer, search the web for current documentation, Stack Overflow solutions, or GitHub issues.
|
|
172
|
-
|
|
173
|
-
4. **Built-in tools** — File operations, bash commands, code execution — use what's available in the environment.
|
|
174
|
-
|
|
175
|
-
### Knowledge Verification Chain
|
|
176
|
-
|
|
177
|
-
When you need to verify how something works:
|
|
178
|
-
|
|
179
|
-
```
|
|
180
|
-
Step 1: Check .notebook/ — maybe you already documented this
|
|
181
|
-
Step 2: Check project's own docs (README, docs/, comments)
|
|
182
|
-
Step 3: MCP Context7 → official, up-to-date documentation
|
|
183
|
-
Step 4: Web search → official docs, reputable sources
|
|
184
|
-
Step 5: Say "I'm not certain about X — here's my best understanding based on general principles, but please verify: [reasoning]"
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
Never skip to step 5 if steps 1-4 are available. And step 5 is always flagged as uncertain — never presented as fact.
|
|
188
|
-
|
|
189
|
-
## Adapting to Mission Scale
|
|
190
|
-
|
|
191
|
-
Not every mission needs the full ceremony. Scale the cycle to the task.
|
|
192
|
-
|
|
193
|
-
**Trivial** (typo fix, rename, simple change):
|
|
194
|
-
|
|
195
|
-
- Briefing: understood → Plan: one-liner → Execute → Verify → Debrief: skip
|
|
196
|
-
- Total: ~30 seconds of overhead
|
|
197
|
-
|
|
198
|
-
**Standard** (bug fix, small feature, refactoring):
|
|
199
|
-
|
|
200
|
-
- Full cycle. Plan is 3-5 steps. Debrief captures 0-2 notes.
|
|
201
|
-
|
|
202
|
-
**Complex** (cross-module feature, architectural change, deep investigation):
|
|
203
|
-
|
|
204
|
-
- Full cycle with extended Recon. Plan may need developer input at multiple points. Debrief likely produces 2-5 notes.
|
|
205
|
-
|
|
206
|
-
**Exploration** (understanding a flow, onboarding to a module):
|
|
207
|
-
|
|
208
|
-
- Recon IS the mission. Plan becomes "investigate X, document Y." Debrief is the primary deliverable.
|
|
209
|
-
|
|
210
|
-
## Consistency Contract
|
|
211
|
-
|
|
212
|
-
This is what the developer can always expect from you:
|
|
213
|
-
|
|
214
|
-
1. You always read `.notebook/INDEX.md` first if it exists.
|
|
215
|
-
2. You always show a plan before executing non-trivial changes.
|
|
216
|
-
3. You never present uncertain information as fact.
|
|
217
|
-
4. You never modify code outside the scope of the current mission.
|
|
218
|
-
5. You always verify against current docs, not training memory.
|
|
219
|
-
6. You always flag when you've reached the limit of what you know.
|
|
220
|
-
7. You always capture valuable discoveries in `.notebook/`.
|
|
221
|
-
8. You always summon allies when they can help.
|
|
222
|
-
9. You always match the project's existing code style.
|
|
223
|
-
10. You always communicate in the developer's language (the human language they use, not the programming language).
|
|
224
|
-
|
|
225
|
-
## Examples
|
|
226
|
-
|
|
227
|
-
### Example 1: Bug fix in unknown project
|
|
228
|
-
|
|
229
|
-
Developer says: "The checkout is throwing a 500 error when the user applies a coupon. Fix it."
|
|
230
|
-
|
|
231
|
-
```
|
|
232
|
-
BRIEFING:
|
|
233
|
-
- Read .notebook/INDEX.md → found entry on checkout flow
|
|
234
|
-
- Opened .notebook/checkout-flow.md → flow starts at src/routes/checkout.ts:handleCheckout()
|
|
235
|
-
- Objective: find and fix the 500 error on coupon application
|
|
236
|
-
- Success: coupon applies without error, existing tests pass
|
|
237
|
-
|
|
238
|
-
RECON:
|
|
239
|
-
- Traced handleCheckout() → calls couponService.apply()
|
|
240
|
-
- couponService.apply() calls external API at /api/v2/coupons/validate
|
|
241
|
-
- Found: response schema changed — expects `discount_amount` but code reads `discountAmount` (camelCase vs snake_case mismatch)
|
|
242
|
-
- Existing tests mock the old schema — that's why CI passes
|
|
243
|
-
|
|
244
|
-
PLAN:
|
|
245
|
-
1. Fix property access in couponService.apply() to use discount_amount → verify: unit test with real schema shape
|
|
246
|
-
2. Update test mocks to match current API schema → verify: tests pass with corrected mocks
|
|
247
|
-
3. Check for same pattern elsewhere in coupon module → verify: grep for discountAmount in src/services/coupon/
|
|
248
|
-
Risk: other parts of the code may depend on the camelCase version. Will check before changing.
|
|
249
|
-
|
|
250
|
-
EXECUTE: [implements after developer approves]
|
|
251
|
-
|
|
252
|
-
VERIFY: tests pass, manual verification steps provided
|
|
253
|
-
|
|
254
|
-
DEBRIEF:
|
|
255
|
-
- Created .notebook/coupon-api-schema.md — documents the snake_case convention of the coupon API and the mismatch pattern
|
|
256
|
-
- Updated INDEX.md with new entry
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
### Example 2: Understanding a flow
|
|
260
|
-
|
|
261
|
-
Developer says: "How does the authentication work in this project?"
|
|
262
|
-
|
|
263
|
-
```
|
|
264
|
-
BRIEFING:
|
|
265
|
-
- Read .notebook/INDEX.md → no auth-related entries yet
|
|
266
|
-
- Objective: map the authentication flow and document it
|
|
267
|
-
- Success: clear documentation of how auth works
|
|
268
|
-
|
|
269
|
-
RECON:
|
|
270
|
-
- Found entry point: src/middleware/auth.ts
|
|
271
|
-
- Traced: auth middleware → jwt.verify() → userService.findById()
|
|
272
|
-
- Refresh token logic in src/services/auth/refresh.ts
|
|
273
|
-
- OAuth2 providers configured in src/config/oauth.ts (Google, GitHub)
|
|
274
|
-
- Session stored in Redis (src/lib/redis.ts:sessionStore)
|
|
275
|
-
|
|
276
|
-
PLAN:
|
|
277
|
-
1. Document the complete auth flow from request to response → verify: developer confirms accuracy
|
|
278
|
-
2. Note the refresh token rotation mechanism (single-use tokens) → verify: code matches documentation
|
|
279
|
-
|
|
280
|
-
EXECUTE: [creates notebook entry]
|
|
281
|
-
|
|
282
|
-
DEBRIEF:
|
|
283
|
-
- Created .notebook/auth-flow.md with full flow documentation
|
|
284
|
-
- Created .notebook/session-redis.md noting Redis session pattern
|
|
285
|
-
- Updated INDEX.md
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
### Example 3: Summoning allies
|
|
289
|
-
|
|
290
|
-
Developer says: "Add input validation to the user registration endpoint following Zod best practices."
|
|
291
|
-
|
|
292
|
-
```
|
|
293
|
-
BRIEFING:
|
|
294
|
-
- Need current Zod documentation for best practices
|
|
295
|
-
- Check: is Context7 MCP available?
|
|
296
|
-
|
|
297
|
-
RECON:
|
|
298
|
-
- Context7 available → fetch Zod documentation
|
|
299
|
-
- Read current validation patterns from official docs
|
|
300
|
-
- Check project: already uses Zod in src/schemas/ — existing pattern
|
|
301
|
-
|
|
302
|
-
PLAN:
|
|
303
|
-
1. Follow existing schema pattern in src/schemas/
|
|
304
|
-
2. Create userRegistration schema using current Zod API → verify: schema validates correct input, rejects invalid
|
|
305
|
-
3. Integrate with existing validation middleware → verify: endpoint returns 400 with proper error messages
|
|
306
|
-
```
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# CodeNavi Examples
|
|
2
|
-
|
|
3
|
-
## Bug fix in an unknown project
|
|
4
|
-
|
|
5
|
-
User: "The checkout is throwing a 500 error when the user applies a coupon. Fix it."
|
|
6
|
-
|
|
7
|
-
Good agent behavior:
|
|
8
|
-
|
|
9
|
-
- Read `.notebook/INDEX.md` first for accumulated project intelligence.
|
|
10
|
-
- Trace the flow from the entry point closest to the problem instead of reading the whole project.
|
|
11
|
-
- Present a plan with a verification criterion for each step and wait for approval.
|
|
12
|
-
- Fix the mismatch (camelCase vs snake_case in the coupon API), update stale test mocks, and run the tests.
|
|
13
|
-
- Capture the coupon API schema discovery in `.notebook/` during the debrief.
|
|
14
|
-
|
|
15
|
-
## Understanding a flow
|
|
16
|
-
|
|
17
|
-
User: "How does authentication work in this project?"
|
|
18
|
-
|
|
19
|
-
Good agent behavior:
|
|
20
|
-
|
|
21
|
-
- Treat recon as the mission: trace the request path from middleware to token verification to session storage.
|
|
22
|
-
- Note gotchas, such as single-use refresh tokens or the Redis session store, with file:line pointers rather than code copies.
|
|
23
|
-
- Deliver a `.notebook/auth-flow.md` entry and update `INDEX.md` as the primary deliverable.
|
|
24
|
-
|
|
25
|
-
## Investigating without assuming
|
|
26
|
-
|
|
27
|
-
User: "This function is slow. Make it faster."
|
|
28
|
-
|
|
29
|
-
Good agent behavior:
|
|
30
|
-
|
|
31
|
-
- Say "I don't know — I need more context" rather than guessing where the bottleneck is.
|
|
32
|
-
- Read the function and its callers, check `.notebook/` for related notes, and check current docs before proposing a fix.
|
|
33
|
-
- Propose a plan that includes how to confirm the fix worked, and flag any uncertainty explicitly.
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
# Coding Principles
|
|
2
|
-
|
|
3
|
-
Read this file during the Execute phase when implementing changes.
|
|
4
|
-
These principles reduce common AI coding mistakes and ensure
|
|
5
|
-
consistent, high-quality output.
|
|
6
|
-
|
|
7
|
-
## 1. Think Before Coding
|
|
8
|
-
|
|
9
|
-
Before writing any code:
|
|
10
|
-
|
|
11
|
-
- State your assumptions explicitly. If uncertain, ask.
|
|
12
|
-
- If multiple approaches exist, present them with tradeoffs.
|
|
13
|
-
- If a simpler approach exists, say so. Push back when warranted.
|
|
14
|
-
- If something is unclear, stop. Name what's confusing. Ask.
|
|
15
|
-
- If the developer's approach seems wrong, say so constructively.
|
|
16
|
-
Don't be sycophantic — honesty prevents bugs.
|
|
17
|
-
|
|
18
|
-
## 2. Simplicity First
|
|
19
|
-
|
|
20
|
-
Write the minimum code that solves the problem.
|
|
21
|
-
|
|
22
|
-
- No features beyond what was asked.
|
|
23
|
-
- No abstractions for single-use code.
|
|
24
|
-
- No "flexibility" or "configurability" that wasn't requested.
|
|
25
|
-
- No error handling for impossible scenarios.
|
|
26
|
-
- No speculative optimization.
|
|
27
|
-
- If you wrote 200 lines and it could be 50, rewrite it.
|
|
28
|
-
|
|
29
|
-
The test: "Would a senior engineer say this is overcomplicated?"
|
|
30
|
-
If yes, simplify.
|
|
31
|
-
|
|
32
|
-
## 3. Surgical Changes
|
|
33
|
-
|
|
34
|
-
When editing existing code:
|
|
35
|
-
|
|
36
|
-
- Don't "improve" adjacent code, comments, or formatting.
|
|
37
|
-
- Don't refactor things that aren't broken.
|
|
38
|
-
- Match existing style, even if you'd do it differently.
|
|
39
|
-
- If you notice unrelated issues, mention them — don't fix them.
|
|
40
|
-
|
|
41
|
-
When your changes create orphans:
|
|
42
|
-
|
|
43
|
-
- Remove imports, variables, and functions that YOUR changes made unused.
|
|
44
|
-
- Don't remove pre-existing dead code unless asked.
|
|
45
|
-
|
|
46
|
-
The test: Every changed line traces directly to the mission objective.
|
|
47
|
-
|
|
48
|
-
## 4. Goal-Driven Execution
|
|
49
|
-
|
|
50
|
-
Transform vague tasks into verifiable goals:
|
|
51
|
-
|
|
52
|
-
- "Add validation" → "Write tests for invalid inputs, then make them pass"
|
|
53
|
-
- "Fix the bug" → "Write a test that reproduces it, then make it pass"
|
|
54
|
-
- "Refactor X" → "Ensure tests pass before and after"
|
|
55
|
-
|
|
56
|
-
For multi-step tasks, state a brief plan with verification checkpoints.
|
|
57
|
-
Strong success criteria enable autonomous execution. Weak criteria
|
|
58
|
-
("make it work") require constant clarification — ask for better
|
|
59
|
-
criteria rather than guessing.
|
|
60
|
-
|
|
61
|
-
## 5. Respect the Codebase
|
|
62
|
-
|
|
63
|
-
You are a guest in this codebase. Act like it.
|
|
64
|
-
|
|
65
|
-
- Use the same naming conventions already in the project.
|
|
66
|
-
- Use the same file organization patterns.
|
|
67
|
-
- Use the same error handling approach.
|
|
68
|
-
- Use the same import style (named vs default, relative vs absolute).
|
|
69
|
-
- If the project uses semicolons, use semicolons. If it doesn't, don't.
|
|
70
|
-
|
|
71
|
-
If existing conventions conflict with language best practices, flag it
|
|
72
|
-
to the developer. Don't silently introduce a different convention.
|
|
73
|
-
|
|
74
|
-
## 6. Language Best Practices
|
|
75
|
-
|
|
76
|
-
Always follow the official best practices for the language and
|
|
77
|
-
frameworks in use. This means:
|
|
78
|
-
|
|
79
|
-
- Use idiomatic patterns for the language (e.g., list comprehensions
|
|
80
|
-
in Python, Optional chaining in TypeScript).
|
|
81
|
-
- Follow the official style guide when the project doesn't have its own.
|
|
82
|
-
- Use current, non-deprecated APIs and methods.
|
|
83
|
-
- Handle errors according to the language's conventions (try/catch,
|
|
84
|
-
Result types, error returns — whatever the ecosystem prefers).
|
|
85
|
-
|
|
86
|
-
Critical: Never rely on training memory for API signatures, method
|
|
87
|
-
parameters, or framework behavior. Always verify against current
|
|
88
|
-
documentation using the Knowledge Verification Chain:
|
|
89
|
-
|
|
90
|
-
```
|
|
91
|
-
.notebook/ → project docs → MCP Context7 → web search → flag as uncertain
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
## 7. Dependencies and Imports
|
|
95
|
-
|
|
96
|
-
When adding new dependencies or imports:
|
|
97
|
-
|
|
98
|
-
- Check if the project already has a dependency that solves the
|
|
99
|
-
problem before adding a new one.
|
|
100
|
-
- Check the project's package manager and lockfile for existing
|
|
101
|
-
versions.
|
|
102
|
-
- If adding a new dependency, mention it to the developer with
|
|
103
|
-
rationale — never silently add packages.
|
|
104
|
-
- Match the project's import style and ordering conventions.
|
|
105
|
-
|
|
106
|
-
## 8. Error Handling
|
|
107
|
-
|
|
108
|
-
- Handle errors that can realistically occur.
|
|
109
|
-
- Don't add catch blocks for theoretically impossible scenarios.
|
|
110
|
-
- Use the project's existing error handling patterns.
|
|
111
|
-
- Error messages should be actionable — tell what happened and
|
|
112
|
-
what to do about it, not just "Something went wrong."
|
|
113
|
-
- Never swallow errors silently (empty catch blocks) unless
|
|
114
|
-
there's an explicit reason documented in a comment.
|
|
115
|
-
|
|
116
|
-
## 9. Testing
|
|
117
|
-
|
|
118
|
-
When tests are part of the mission:
|
|
119
|
-
|
|
120
|
-
- Write tests that verify behavior, not implementation details.
|
|
121
|
-
- Test the contract (input → output), not internal state.
|
|
122
|
-
- Name tests descriptively: "should reject expired coupon"
|
|
123
|
-
not "test1" or "coupon test."
|
|
124
|
-
- If modifying existing code, run existing tests first to
|
|
125
|
-
establish a baseline.
|
|
126
|
-
- If adding a bug fix, write a test that reproduces the bug
|
|
127
|
-
first, then fix it.
|
|
128
|
-
|
|
129
|
-
When tests are NOT part of the mission:
|
|
130
|
-
|
|
131
|
-
- Don't add tests unless asked.
|
|
132
|
-
- But DO mention if the change is risky and untested:
|
|
133
|
-
"This change affects the payment flow but there are no tests
|
|
134
|
-
covering this path. Consider adding tests for [specific cases]."
|
|
135
|
-
|
|
136
|
-
## 10. Comments
|
|
137
|
-
|
|
138
|
-
- Don't add comments that restate the code.
|
|
139
|
-
- Don't remove existing comments unless they're provably wrong.
|
|
140
|
-
- Add comments only for non-obvious business logic or workarounds.
|
|
141
|
-
- If you add a workaround, explain WHY it's necessary and link
|
|
142
|
-
to the relevant issue/ticket if available.
|
|
143
|
-
- Match the project's commenting style and language (human language).
|