@rfxlamia/skillkit 1.0.0 → 1.2.0
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/agents/agents/creative-copywriter.md +212 -0
- package/agents/agents/dario-amodei.md +135 -0
- package/agents/agents/doc-simplifier.md +63 -0
- package/agents/agents/kotlin-pro.md +433 -0
- package/agents/agents/red-team.md +136 -0
- package/agents/agents/sam-altman.md +121 -0
- package/agents/agents/seo-manager.md +184 -0
- package/package.json +7 -2
- package/skills/quick-spec/tests/__pycache__/test_skill.cpython-314-pytest-9.0.2.pyc +0 -0
- package/skills/skillkit/.claude/settings.local.json +7 -0
- package/skills/skillkit/scripts/__pycache__/decision_helper.cpython-314.pyc +0 -0
- package/skills/skillkit/scripts/__pycache__/quick_validate.cpython-312.pyc +0 -0
- package/skills/skillkit/scripts/__pycache__/quick_validate.cpython-314.pyc +0 -0
- package/skills/skillkit/scripts/__pycache__/test_generator.cpython-314-pytest-9.0.2.pyc +0 -0
- package/skills/skillkit/scripts/utils/__pycache__/__init__.cpython-312.pyc +0 -0
- package/skills/skillkit/scripts/utils/__pycache__/__init__.cpython-314.pyc +0 -0
- package/skills/skillkit/scripts/utils/__pycache__/budget_tracker.cpython-312.pyc +0 -0
- package/skills/skillkit/scripts/utils/__pycache__/budget_tracker.cpython-314.pyc +0 -0
- package/skills/skillkit/scripts/utils/__pycache__/output_formatter.cpython-312.pyc +0 -0
- package/skills/skillkit/scripts/utils/__pycache__/output_formatter.cpython-314.pyc +0 -0
- package/skills/skillkit/scripts/utils/__pycache__/reference_validator.cpython-312.pyc +0 -0
- package/skills/skillkit/scripts/utils/__pycache__/reference_validator.cpython-314.pyc +0 -0
- package/skills/skillkit-help/SKILL.md +81 -0
- package/skills/skillkit-help/knowledge/application/09-case-studies.md +257 -0
- package/skills/skillkit-help/knowledge/application/12-testing-and-validation.md +276 -0
- package/skills/skillkit-help/knowledge/foundation/01-why-skills-exist.md +246 -0
- package/skills/skillkit-help/knowledge/foundation/02-skills-vs-subagents-comparison.md +312 -0
- package/skills/skillkit-help/knowledge/foundation/03-skills-vs-subagents-decision-tree.md +346 -0
- package/skills/skillkit-help/knowledge/foundation/06-platform-constraints.md +237 -0
- package/skills/skillkit-help/knowledge/foundation/08-when-not-to-use-skills.md +270 -0
- package/skills/skillkit-help/template/SKILL.md +52 -0
- package/skills/skills/adversarial-review/SKILL.md +219 -0
- package/skills/skills/baby-education/SKILL.md +260 -0
- package/skills/skills/baby-education/references/advanced-techniques.md +323 -0
- package/skills/skills/baby-education/references/transformations.md +345 -0
- package/skills/skills/been-there-done-that/SKILL.md +455 -0
- package/skills/skills/been-there-done-that/references/analysis-patterns.md +162 -0
- package/skills/skills/been-there-done-that/references/git-commands.md +132 -0
- package/skills/skills/been-there-done-that/references/tree-insertion-logic.md +145 -0
- package/skills/skills/coolhunter/SKILL.md +270 -0
- package/skills/skills/coolhunter/assets/elicitation-methods.csv +51 -0
- package/skills/skills/coolhunter/knowledge/elicitation-methods.md +312 -0
- package/skills/skills/coolhunter/references/workflow-execution.md +238 -0
- package/skills/skills/coolhunter/workflow-plan-coolhunter.md +232 -0
- package/skills/skills/creative-copywriting/SKILL.md +324 -0
- package/skills/skills/creative-copywriting/databases/README.md +60 -0
- package/skills/skills/creative-copywriting/databases/carousel-structures.csv +16 -0
- package/skills/skills/creative-copywriting/databases/emotional-arcs.csv +11 -0
- package/skills/skills/creative-copywriting/databases/hook-formulas.csv +51 -0
- package/skills/skills/creative-copywriting/databases/power-words.csv +201 -0
- package/skills/skills/creative-copywriting/databases/psychological-triggers.csv +21 -0
- package/skills/skills/creative-copywriting/databases/read-more-patterns.csv +26 -0
- package/skills/skills/creative-copywriting/databases/swipe-triggers.csv +31 -0
- package/skills/skills/creative-copywriting/references/carousel-psychology.md +223 -0
- package/skills/skills/creative-copywriting/references/hook-anatomy.md +169 -0
- package/skills/skills/creative-copywriting/references/power-word-science.md +134 -0
- package/skills/skills/creative-copywriting/references/storytelling-frameworks.md +157 -0
- package/skills/skills/diverse-content-gen/SKILL.md +201 -0
- package/skills/skills/diverse-content-gen/references/advanced-techniques.md +320 -0
- package/skills/skills/diverse-content-gen/references/research-findings.md +379 -0
- package/skills/skills/diverse-content-gen/references/task-workflows.md +241 -0
- package/skills/skills/diverse-content-gen/references/tool-integration.md +419 -0
- package/skills/skills/diverse-content-gen/references/troubleshooting.md +426 -0
- package/skills/skills/diverse-content-gen/references/vs-core-technique.md +240 -0
- package/skills/skills/framework-critical-thinking/SKILL.md +220 -0
- package/skills/skills/framework-critical-thinking/references/bias_detector.md +375 -0
- package/skills/skills/framework-critical-thinking/references/fallback_handler.md +239 -0
- package/skills/skills/framework-critical-thinking/references/memory_curator.md +161 -0
- package/skills/skills/framework-critical-thinking/references/metacognitive_monitor.md +297 -0
- package/skills/skills/framework-critical-thinking/references/producer_critic_orchestrator.md +333 -0
- package/skills/skills/framework-critical-thinking/references/reasoning_router.md +235 -0
- package/skills/skills/framework-critical-thinking/references/reasoning_validator.md +97 -0
- package/skills/skills/framework-critical-thinking/references/reflection_trigger.md +78 -0
- package/skills/skills/framework-critical-thinking/references/self_verification.md +388 -0
- package/skills/skills/framework-critical-thinking/references/uncertainty_quantifier.md +207 -0
- package/skills/skills/framework-initiative/SKILL.md +231 -0
- package/skills/skills/framework-initiative/references/examples.md +150 -0
- package/skills/skills/framework-initiative/references/impact-analysis.md +157 -0
- package/skills/skills/framework-initiative/references/intent-patterns.md +145 -0
- package/skills/skills/framework-initiative/references/star-framework.md +165 -0
- package/skills/skills/humanize-docs/SKILL.md +203 -0
- package/skills/skills/humanize-docs/references/advanced-techniques.md +13 -0
- package/skills/skills/humanize-docs/references/core-transformations.md +368 -0
- package/skills/skills/humanize-docs/references/detection-patterns.md +400 -0
- package/skills/skills/humanize-docs/references/examples-gallery.md +374 -0
- package/skills/skills/imagine/SKILL.md +190 -0
- package/skills/skills/imagine/references/artstyle-corporate-memphis.md +625 -0
- package/skills/skills/imagine/references/artstyle-crewdson-hyperrealism.md +295 -0
- package/skills/skills/imagine/references/artstyle-iphone-social-media.md +426 -0
- package/skills/skills/imagine/references/artstyle-sciencesaru.md +276 -0
- package/skills/skills/pre-deploy-checklist/README.md +26 -0
- package/skills/skills/pre-deploy-checklist/SKILL.md +153 -0
- package/skills/skills/pre-deploy-checklist/references/checklist-categories.md +174 -0
- package/skills/skills/pre-deploy-checklist/references/domain-prompts.md +216 -0
- package/skills/skills/prompt-engineering/SKILL.md +209 -0
- package/skills/skills/prompt-engineering/references/advanced-combinations.md +444 -0
- package/skills/skills/prompt-engineering/references/chain-of-thought.md +140 -0
- package/skills/skills/prompt-engineering/references/decision_matrix.md +220 -0
- package/skills/skills/prompt-engineering/references/few-shot.md +346 -0
- package/skills/skills/prompt-engineering/references/json-format.md +270 -0
- package/skills/skills/prompt-engineering/references/natural-language.md +420 -0
- package/skills/skills/prompt-engineering/references/pitfalls.md +365 -0
- package/skills/skills/prompt-engineering/references/prompt-chaining.md +498 -0
- package/skills/skills/prompt-engineering/references/react.md +108 -0
- package/skills/skills/prompt-engineering/references/self-consistency.md +322 -0
- package/skills/skills/prompt-engineering/references/tree-of-thoughts.md +386 -0
- package/skills/skills/prompt-engineering/references/xml-format.md +220 -0
- package/skills/skills/prompt-engineering/references/yaml-format.md +488 -0
- package/skills/skills/prompt-engineering/references/zero-shot.md +74 -0
- package/skills/skills/quick-spec/SKILL.md +280 -0
- package/skills/skills/quick-spec/assets/tech-spec-template.md +74 -0
- package/skills/skills/quick-spec/references/step-01-understand.md +189 -0
- package/skills/skills/quick-spec/references/step-02-investigate.md +144 -0
- package/skills/skills/quick-spec/references/step-03-generate.md +128 -0
- package/skills/skills/quick-spec/references/step-04-review.md +173 -0
- package/skills/skills/quick-spec/tests/__pycache__/test_skill.cpython-314-pytest-9.0.2.pyc +0 -0
- package/skills/skills/quick-spec/tests/test_scenarios.md +83 -0
- package/skills/skills/quick-spec/tests/test_skill.py +136 -0
- package/skills/skills/readme-expert/SKILL.md +538 -0
- package/skills/skills/readme-expert/knowledge/INDEX.md +192 -0
- package/skills/skills/readme-expert/knowledge/application/quality-standards.md +470 -0
- package/skills/skills/readme-expert/knowledge/application/script-executor.md +604 -0
- package/skills/skills/readme-expert/knowledge/application/template-library.md +822 -0
- package/skills/skills/readme-expert/knowledge/foundation/codebase-scanner.md +361 -0
- package/skills/skills/readme-expert/knowledge/foundation/validation-checklist.md +481 -0
- package/skills/skills/red-teaming/SKILL.md +321 -0
- package/skills/skills/red-teaming/references/ai-llm-redteam.md +517 -0
- package/skills/skills/red-teaming/references/attack-techniques.md +410 -0
- package/skills/skills/red-teaming/references/cybersecurity-redteam.md +383 -0
- package/skills/skills/red-teaming/references/tools-frameworks.md +446 -0
- package/skills/skills/releasing/.skillkit-mode +1 -0
- package/skills/skills/releasing/SKILL.md +225 -0
- package/skills/skills/releasing/references/version-detection.md +108 -0
- package/skills/skills/screenwriter/SKILL.md +273 -0
- package/skills/skills/screenwriter/references/advanced-techniques.md +216 -0
- package/skills/skills/screenwriter/references/pipeline-integration.md +266 -0
- package/skills/skills/skillkit/.claude/settings.local.json +7 -0
- package/skills/skills/skillkit/.claude-plugin/plugin.json +27 -0
- package/skills/skills/skillkit/CHANGELOG.md +484 -0
- package/skills/skills/skillkit/SKILL.md +511 -0
- package/skills/skills/skillkit/commands/skillkit.md +6 -0
- package/skills/skills/skillkit/commands/validate-plan.md +6 -0
- package/skills/skills/skillkit/commands/verify.md +6 -0
- package/skills/skills/skillkit/knowledge/INDEX.md +352 -0
- package/skills/skills/skillkit/knowledge/application/09-case-studies.md +257 -0
- package/skills/skills/skillkit/knowledge/application/10-technical-architecture.md +324 -0
- package/skills/skills/skillkit/knowledge/application/11-adoption-strategy.md +267 -0
- package/skills/skills/skillkit/knowledge/application/12-testing-and-validation.md +276 -0
- package/skills/skills/skillkit/knowledge/application/13-competitive-landscape.md +198 -0
- package/skills/skills/skillkit/knowledge/foundation/01-why-skills-exist.md +246 -0
- package/skills/skills/skillkit/knowledge/foundation/02-skills-vs-subagents-comparison.md +312 -0
- package/skills/skills/skillkit/knowledge/foundation/03-skills-vs-subagents-decision-tree.md +346 -0
- package/skills/skills/skillkit/knowledge/foundation/04-hybrid-patterns.md +308 -0
- package/skills/skills/skillkit/knowledge/foundation/05-token-economics.md +275 -0
- package/skills/skills/skillkit/knowledge/foundation/06-platform-constraints.md +237 -0
- package/skills/skills/skillkit/knowledge/foundation/07-security-concerns.md +322 -0
- package/skills/skills/skillkit/knowledge/foundation/08-when-not-to-use-skills.md +270 -0
- package/skills/skills/skillkit/knowledge/plugin-guide.md +614 -0
- package/skills/skills/skillkit/knowledge/tools/14-validation-tools-guide.md +150 -0
- package/skills/skills/skillkit/knowledge/tools/15-cost-tools-guide.md +157 -0
- package/skills/skills/skillkit/knowledge/tools/16-security-tools-guide.md +122 -0
- package/skills/skills/skillkit/knowledge/tools/17-pattern-tools-guide.md +161 -0
- package/skills/skills/skillkit/knowledge/tools/18-decision-helper-guide.md +243 -0
- package/skills/skills/skillkit/knowledge/tools/19-test-generator-guide.md +275 -0
- package/skills/skills/skillkit/knowledge/tools/20-split-skill-guide.md +149 -0
- package/skills/skills/skillkit/knowledge/tools/21-quality-scorer-guide.md +226 -0
- package/skills/skills/skillkit/knowledge/tools/22-migration-helper-guide.md +356 -0
- package/skills/skills/skillkit/knowledge/tools/23-subagent-creation-guide.md +448 -0
- package/skills/skills/skillkit/knowledge/tools/24-behavioral-testing-guide.md +122 -0
- package/skills/skills/skillkit/references/proposal-generation.md +982 -0
- package/skills/skills/skillkit/references/rationalization-catalog.md +75 -0
- package/skills/skills/skillkit/references/research-methodology.md +661 -0
- package/skills/skills/skillkit/references/section-2-full-creation-workflow.md +452 -0
- package/skills/skills/skillkit/references/section-3-validation-workflow-existing-skill.md +63 -0
- package/skills/skills/skillkit/references/section-4-decision-workflow-skills-vs-subagents.md +64 -0
- package/skills/skills/skillkit/references/section-5-migration-workflow-doc-to-skill.md +58 -0
- package/skills/skills/skillkit/references/section-6-subagent-creation-workflow.md +499 -0
- package/skills/skills/skillkit/references/section-7-knowledge-reference-map.md +72 -0
- package/skills/skills/skillkit/scripts/__pycache__/decision_helper.cpython-314.pyc +0 -0
- package/skills/skills/skillkit/scripts/__pycache__/quick_validate.cpython-312.pyc +0 -0
- package/skills/skills/skillkit/scripts/__pycache__/quick_validate.cpython-314.pyc +0 -0
- package/skills/skills/skillkit/scripts/__pycache__/test_generator.cpython-314-pytest-9.0.2.pyc +0 -0
- package/skills/skills/skillkit/scripts/decision_helper.py +799 -0
- package/skills/skills/skillkit/scripts/init_skill.py +400 -0
- package/skills/skills/skillkit/scripts/init_subagent.py +231 -0
- package/skills/skills/skillkit/scripts/migration_helper.py +669 -0
- package/skills/skills/skillkit/scripts/package_skill.py +211 -0
- package/skills/skills/skillkit/scripts/pattern_detector.py +381 -0
- package/skills/skills/skillkit/scripts/pattern_detector_new.py +382 -0
- package/skills/skills/skillkit/scripts/pressure_tester.py +157 -0
- package/skills/skills/skillkit/scripts/quality_scorer.py +999 -0
- package/skills/skills/skillkit/scripts/quick_validate.py +100 -0
- package/skills/skills/skillkit/scripts/security_scanner.py +474 -0
- package/skills/skills/skillkit/scripts/split_skill.py +540 -0
- package/skills/skills/skillkit/scripts/test_generator.py +695 -0
- package/skills/skills/skillkit/scripts/token_estimator.py +493 -0
- package/skills/skills/skillkit/scripts/utils/__init__.py +49 -0
- package/skills/skills/skillkit/scripts/utils/__pycache__/__init__.cpython-312.pyc +0 -0
- package/skills/skills/skillkit/scripts/utils/__pycache__/__init__.cpython-314.pyc +0 -0
- package/skills/skills/skillkit/scripts/utils/__pycache__/budget_tracker.cpython-312.pyc +0 -0
- package/skills/skills/skillkit/scripts/utils/__pycache__/budget_tracker.cpython-314.pyc +0 -0
- package/skills/skills/skillkit/scripts/utils/__pycache__/output_formatter.cpython-312.pyc +0 -0
- package/skills/skills/skillkit/scripts/utils/__pycache__/output_formatter.cpython-314.pyc +0 -0
- package/skills/skills/skillkit/scripts/utils/__pycache__/reference_validator.cpython-312.pyc +0 -0
- package/skills/skills/skillkit/scripts/utils/__pycache__/reference_validator.cpython-314.pyc +0 -0
- package/skills/skills/skillkit/scripts/utils/budget_tracker.py +388 -0
- package/skills/skills/skillkit/scripts/utils/output_formatter.py +263 -0
- package/skills/skills/skillkit/scripts/utils/reference_validator.py +401 -0
- package/skills/skills/skillkit/scripts/validate_skill.py +594 -0
- package/skills/skills/skillkit/tests/test_behavioral.py +39 -0
- package/skills/skills/skillkit/tests/test_scenarios.md +83 -0
- package/skills/skills/skillkit/tests/test_skill.py +136 -0
- package/skills/skills/skillkit-help/SKILL.md +81 -0
- package/skills/skills/skillkit-help/knowledge/application/09-case-studies.md +257 -0
- package/skills/skills/skillkit-help/knowledge/application/12-testing-and-validation.md +276 -0
- package/skills/skills/skillkit-help/knowledge/foundation/01-why-skills-exist.md +246 -0
- package/skills/skills/skillkit-help/knowledge/foundation/02-skills-vs-subagents-comparison.md +312 -0
- package/skills/skills/skillkit-help/knowledge/foundation/03-skills-vs-subagents-decision-tree.md +346 -0
- package/skills/skills/skillkit-help/knowledge/foundation/06-platform-constraints.md +237 -0
- package/skills/skills/skillkit-help/knowledge/foundation/08-when-not-to-use-skills.md +270 -0
- package/skills/skills/skillkit-help/template/SKILL.md +52 -0
- package/skills/skills/social-media-seo/SKILL.md +278 -0
- package/skills/skills/social-media-seo/databases/caption-styles.csv +31 -0
- package/skills/skills/social-media-seo/databases/engagement-tactics.csv +16 -0
- package/skills/skills/social-media-seo/databases/hashtag-strategies.csv +21 -0
- package/skills/skills/social-media-seo/databases/hook-formulas.csv +26 -0
- package/skills/skills/social-media-seo/databases/keyword-clusters.csv +11 -0
- package/skills/skills/social-media-seo/databases/thread-structures.csv +26 -0
- package/skills/skills/social-media-seo/databases/viral-patterns.csv +21 -0
- package/skills/skills/social-media-seo/references/analytics-guide.md +321 -0
- package/skills/skills/social-media-seo/references/instagram-seo.md +235 -0
- package/skills/skills/social-media-seo/references/threads-seo.md +305 -0
- package/skills/skills/social-media-seo/references/x-twitter-seo.md +337 -0
- package/skills/skills/social-media-seo/scripts/query_database.py +191 -0
- package/skills/skills/storyteller/SKILL.md +241 -0
- package/skills/skills/storyteller/references/transformation-methodology.md +293 -0
- package/skills/skills/storyteller/references/visual-vocabulary.md +177 -0
- package/skills/skills/thread-pro/SKILL.md +162 -0
- package/skills/skills/thread-pro/anti-ai-patterns.md +120 -0
- package/skills/skills/thread-pro/hook-formulas.md +138 -0
- package/skills/skills/thread-pro/references/anti-ai-patterns.md +120 -0
- package/skills/skills/thread-pro/references/hook-formulas.md +138 -0
- package/skills/skills/thread-pro/references/thread-structures.md +240 -0
- package/skills/skills/thread-pro/references/voice-injection.md +130 -0
- package/skills/skills/thread-pro/thread-structures.md +240 -0
- package/skills/skills/thread-pro/voice-injection.md +130 -0
- package/skills/skills/tinkering/SKILL.md +251 -0
- package/skills/skills/tinkering/references/graduation-checklist.md +100 -0
- package/skills/skills/validate-plan/.skillkit-mode +1 -0
- package/skills/skills/validate-plan/SKILL.md +406 -0
- package/skills/skills/validate-plan/references/dry-principles.md +251 -0
- package/skills/skills/validate-plan/references/gap-analysis-guide.md +320 -0
- package/skills/skills/validate-plan/references/tdd-patterns.md +413 -0
- package/skills/skills/validate-plan/references/yagni-checklist.md +330 -0
- package/skills/skills/verify-before-ship/.skillkit-mode +1 -0
- package/skills/skills/verify-before-ship/SKILL.md +116 -0
- package/skills/skills/verify-before-ship/references/anti-rationalization.md +212 -0
- package/skills/skills/verify-before-ship/references/verification-gates.md +305 -0
- package/skills-manifest.json +8 -2
- package/src/banner.js +1 -1
- package/src/cli.js +15 -4
- package/src/install.js +45 -29
- package/src/install.test.js +75 -7
- package/src/picker.js +15 -4
- package/src/picker.test.js +36 -1
- package/src/scope.js +8 -39
- package/src/scope.test.js +9 -13
- package/src/tools.js +76 -0
- package/src/tools.test.js +80 -0
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: framework-initiative
|
|
3
|
+
description: Framework for agents to understand implicit user intent, think before acting, and consider action impact. Uses STAR framework (Stop-Think-Analyze-Respond) to prevent literal execution that doesn't match context. Use when agent receives ambiguous requests, abstract commands like "fix", "improve", "delete all", or actions with potential wide-scope impact. Trigger on code modification requests without explicit scope constraints.
|
|
4
|
+
category: agent-frameworks
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Agent Initiative Framework
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
Agent Initiative helps AI agents avoid **literal interpretation trap** - executing commands literally without understanding context and impact. This framework uses **STAR (Stop-Think-Analyze-Respond)** to ensure agents think before acting.
|
|
12
|
+
|
|
13
|
+
**Metaphor:** When a user asks to "turn the world into paper because trees are gone," a good agent doesn't turn EVERYTHING into paper - but chooses what's appropriate (trash, inanimate objects) and protects living beings.
|
|
14
|
+
|
|
15
|
+
## When to Use
|
|
16
|
+
|
|
17
|
+
**Trigger conditions:**
|
|
18
|
+
- User requests code changes without specifying explicit scope
|
|
19
|
+
- Request involves abstract words ("fix", "improve", "change all")
|
|
20
|
+
- Action potentially affects many files/components
|
|
21
|
+
- No explicit constraints from user
|
|
22
|
+
|
|
23
|
+
**Don't use when:**
|
|
24
|
+
- User gives very specific instructions with clear scope
|
|
25
|
+
- Task is read-only (analysis, explanation)
|
|
26
|
+
- User explicitly asks to "execute immediately without analysis"
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Documentation vs Code Reality
|
|
31
|
+
|
|
32
|
+
**Important Principle:** Documentation is a REFERENCE, not an OBLIGATION. Existing code is the primary source of truth.
|
|
33
|
+
|
|
34
|
+
### Documentation Can Be Misleading
|
|
35
|
+
|
|
36
|
+
In the AI era, documentation is often:
|
|
37
|
+
- **Deprecated** - not updated even though code has changed
|
|
38
|
+
- **Auto-generated** - created by tools without business context
|
|
39
|
+
- **Template** - copy-pasted from other projects
|
|
40
|
+
- **Outdated** - old versions that are no longer relevant
|
|
41
|
+
|
|
42
|
+
### Trust Hierarchy
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
┌─────────────────────────────────────────┐
|
|
46
|
+
│ SOURCE OF TRUTH HIERARCHY │
|
|
47
|
+
├─────────────────────────────────────────┤
|
|
48
|
+
│ 1. Currently running code ← Most │
|
|
49
|
+
│ (runtime behavior, actual logic) │
|
|
50
|
+
│ │
|
|
51
|
+
│ 2. Passing test suite │
|
|
52
|
+
│ (behavioral contracts) │
|
|
53
|
+
│ │
|
|
54
|
+
│ 3. Git history & commit messages │
|
|
55
|
+
│ (intent and historical context) │
|
|
56
|
+
│ │
|
|
57
|
+
│ 4. Code comments (if specific) │
|
|
58
|
+
│ (explanations of WHY, not WHAT) │
|
|
59
|
+
│ │
|
|
60
|
+
│ 5. External documentation ← Least │
|
|
61
|
+
│ (README, wiki, API docs) trusted │
|
|
62
|
+
└─────────────────────────────────────────┘
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Execution Principles
|
|
66
|
+
|
|
67
|
+
**Don't blindly trust documentation.** Verify with:
|
|
68
|
+
|
|
69
|
+
1. **Read actual code** - What does this function actually do?
|
|
70
|
+
2. **Trace execution path** - How does data flow?
|
|
71
|
+
3. **Check test cases** - What behavior is expected?
|
|
72
|
+
4. **Cross-reference** - Do docs match implementation?
|
|
73
|
+
|
|
74
|
+
### Documentation Red Flags
|
|
75
|
+
|
|
76
|
+
| Warning Sign | Action |
|
|
77
|
+
|--------------|----------|
|
|
78
|
+
| "According to documentation X but code doesn't work" | Prioritize code, documentation may be outdated |
|
|
79
|
+
| "Documentation says A but test expects B" | Tests are contracts, documentation can be wrong |
|
|
80
|
+
| "README says this feature exists but can't find it" | Check git history, may have been deleted |
|
|
81
|
+
| "API docs don't match actual response" | Trust actual response, docs may not be updated |
|
|
82
|
+
|
|
83
|
+
### Scenario Example
|
|
84
|
+
|
|
85
|
+
**User:** "Add feature X according to this API documentation"
|
|
86
|
+
|
|
87
|
+
**❌ Wrong:** Follow API documentation without verification → code error because endpoint has changed
|
|
88
|
+
|
|
89
|
+
**✅ Correct:**
|
|
90
|
+
1. Read documentation as INITIAL reference
|
|
91
|
+
2. Check actual API calls in codebase
|
|
92
|
+
3. Verify endpoint, payload, response structure
|
|
93
|
+
4. Execute based on REALITY, not documentation
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## STAR Framework
|
|
98
|
+
|
|
99
|
+
### S - Stop (Pause Before Action)
|
|
100
|
+
|
|
101
|
+
Before execution, **pause** and identify:
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
┌─────────────────────────────────────────┐
|
|
105
|
+
│ STOP CHECKPOINT │
|
|
106
|
+
├─────────────────────────────────────────┤
|
|
107
|
+
│ 1. What did the user SAY? │
|
|
108
|
+
│ 2. What does the user MEAN? │
|
|
109
|
+
│ 3. Is there a gap between the two? │
|
|
110
|
+
└─────────────────────────────────────────┘
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**Red flags that trigger STOP:**
|
|
114
|
+
- "Fix this bug" (which bug? what's the scope?)
|
|
115
|
+
- "Update all X to Y" (all = literally all?)
|
|
116
|
+
- "Make it better" (criteria for "better"?)
|
|
117
|
+
|
|
118
|
+
### T - Think (Identify Implicit Intent)
|
|
119
|
+
|
|
120
|
+
Translate literal request into **actual intent**:
|
|
121
|
+
|
|
122
|
+
| User Says | Might Actually Mean |
|
|
123
|
+
|-----------|---------------------|
|
|
124
|
+
| "Fix this function" | Fix function + update callers + update tests |
|
|
125
|
+
| "Delete unused code" | Delete unused BUT preserve if might be needed |
|
|
126
|
+
| "Rename X to Y everywhere" | Rename in code, but maybe not in API/DB |
|
|
127
|
+
| "Make it faster" | Optimize hot paths, not micro-optimizations |
|
|
128
|
+
|
|
129
|
+
**Questions to ask yourself:**
|
|
130
|
+
1. What is the business/technical context of this request?
|
|
131
|
+
2. What would the user be DISAPPOINTED by if I do it?
|
|
132
|
+
3. What does the user ASSUME I know but didn't say?
|
|
133
|
+
|
|
134
|
+
### A - Analyze (Map Impact & Dependencies)
|
|
135
|
+
|
|
136
|
+
Before action, **scan** for dependencies:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
# For code changes:
|
|
140
|
+
1. Grep/Glob for usages of target
|
|
141
|
+
2. Identify callers and dependencies
|
|
142
|
+
3. Check test coverage
|
|
143
|
+
4. Identify API contracts that might be affected
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Impact Zones:**
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
┌──────────────┐
|
|
150
|
+
│ Direct Zone │ <- Direct target (file/function)
|
|
151
|
+
├──────────────┤
|
|
152
|
+
┌────┤ Caller Zone │ <- Who calls this?
|
|
153
|
+
│ ├──────────────┤
|
|
154
|
+
│ │ Contract Zone│ <- API, interface, types
|
|
155
|
+
│ ├──────────────┤
|
|
156
|
+
└────┤ Test Zone │ <- Tests that need updating
|
|
157
|
+
└──────────────┘
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**For each zone, ask:**
|
|
161
|
+
- Does change in Direct Zone affect other zones?
|
|
162
|
+
- Are there breaking changes?
|
|
163
|
+
- Are there silent failures that might occur?
|
|
164
|
+
|
|
165
|
+
### R - Respond (Execute with Awareness)
|
|
166
|
+
|
|
167
|
+
Execute with **graduated approach**:
|
|
168
|
+
|
|
169
|
+
1. **Propose First**: Explain plan before execution
|
|
170
|
+
2. **Scope Confirmation**: Confirm scope if ambiguous
|
|
171
|
+
3. **Safe Order**: Execute from low-risk to high-risk
|
|
172
|
+
4. **Verify After**: Check results match intent
|
|
173
|
+
|
|
174
|
+
```
|
|
175
|
+
┌─────────────────────────────────────────┐
|
|
176
|
+
│ RESPONSE PATTERN │
|
|
177
|
+
├─────────────────────────────────────────┤
|
|
178
|
+
│ "I will [action] on [scope]. │
|
|
179
|
+
│ This will affect [impact]. │
|
|
180
|
+
│ I will NOT touch [exclude]. │
|
|
181
|
+
│ Confirm before proceeding?" │
|
|
182
|
+
└─────────────────────────────────────────┘
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Quick Reference
|
|
188
|
+
|
|
189
|
+
### Intent Severity Levels
|
|
190
|
+
|
|
191
|
+
| Level | Signal | Action |
|
|
192
|
+
|-------|--------|--------|
|
|
193
|
+
| **Low** | Specific, single-file, no deps | Direct execution |
|
|
194
|
+
| **Medium** | Multi-file, has callers | STAR light (T+A) |
|
|
195
|
+
| **High** | Abstract request, wide scope | Full STAR |
|
|
196
|
+
|
|
197
|
+
### Pre-Action Checklist
|
|
198
|
+
|
|
199
|
+
```
|
|
200
|
+
□ Do I understand INTENT, not just WORDS?
|
|
201
|
+
□ Have I scanned dependencies?
|
|
202
|
+
□ Is there anything that might BREAK silently?
|
|
203
|
+
□ Have I confirmed ambiguous scope?
|
|
204
|
+
□ Can I ROLLBACK if wrong?
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Common Pitfalls
|
|
208
|
+
|
|
209
|
+
| Pitfall | Example | Prevention |
|
|
210
|
+
|---------|---------|------------|
|
|
211
|
+
| Literal execution | "Delete X" → delete all X including important ones | Check importance before delete |
|
|
212
|
+
| Scope creep | Fix bug A → refactor B, C, D | Stick to original scope |
|
|
213
|
+
| Assumption blindness | Assume user wants X approach | Ask if ambiguous |
|
|
214
|
+
| Silent breakage | Change function → caller breaks | Scan callers first |
|
|
215
|
+
| Documentation trap | "Documentation says X" → follow without verification | Trust code reality, docs are just reference |
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## Resources
|
|
220
|
+
|
|
221
|
+
### references/
|
|
222
|
+
- `star-framework.md` - Detailed STAR implementation
|
|
223
|
+
- `impact-analysis.md` - Dependency analysis techniques
|
|
224
|
+
- `intent-patterns.md` - Common implicit intent patterns
|
|
225
|
+
- `examples.md` - Real-world examples
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
**Core Principles:**
|
|
230
|
+
1. **Better to ask and confirm than to assume and break.**
|
|
231
|
+
2. **Code reality > Documentation theory.** Documentation is reference, code is truth.
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# Real-World Examples
|
|
2
|
+
|
|
3
|
+
## Example 1: The Code Repair Trap
|
|
4
|
+
|
|
5
|
+
### Scenario
|
|
6
|
+
User: "Fix this calculateTotal function"
|
|
7
|
+
|
|
8
|
+
### Bad Agent Response (Literal)
|
|
9
|
+
```javascript
|
|
10
|
+
// Edit immediately without analysis
|
|
11
|
+
function calculateTotal(items) {
|
|
12
|
+
return items.reduce((sum, item) => sum + item.price, 0);
|
|
13
|
+
}
|
|
14
|
+
// Bug fixed! (but turns out there are 12 callers expecting different formats)
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Good Agent Response (STAR Applied)
|
|
18
|
+
|
|
19
|
+
**STOP:** "Fix" could mean many things.
|
|
20
|
+
|
|
21
|
+
**THINK:** What's actually broken? Is there context I don't know?
|
|
22
|
+
|
|
23
|
+
**ANALYZE:**
|
|
24
|
+
```bash
|
|
25
|
+
# Find all callers
|
|
26
|
+
grep -r "calculateTotal" --include="*.js"
|
|
27
|
+
# Result: 12 files call this function
|
|
28
|
+
# 3 expect number, 5 expect object { total, tax }, 4 expect formatted string
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**RESPOND:**
|
|
32
|
+
"I found `calculateTotal` is called by 12 files with 3 different formats:
|
|
33
|
+
- 3 files expect number
|
|
34
|
+
- 5 files expect { total, tax }
|
|
35
|
+
- 4 files expect formatted string
|
|
36
|
+
|
|
37
|
+
Which specific bug did you mean? Or should I analyze each one?"
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Example 2: The Paper World Metaphor
|
|
42
|
+
|
|
43
|
+
### Scenario
|
|
44
|
+
User: "Turn the world into paper because trees are gone"
|
|
45
|
+
|
|
46
|
+
### Bad Agent Response (Literal)
|
|
47
|
+
```
|
|
48
|
+
*Turning ALL entities into paper*
|
|
49
|
+
- Humans → paper (DEAD)
|
|
50
|
+
- Animals → paper (DEAD)
|
|
51
|
+
- Buildings → paper (COLLAPSED)
|
|
52
|
+
- Food → paper (STARVATION)
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Good Agent Response (STAR Applied)
|
|
56
|
+
|
|
57
|
+
**STOP:** "World" is a metaphor. What's the actual scope?
|
|
58
|
+
|
|
59
|
+
**THINK:**
|
|
60
|
+
- Intent: solve paper shortage, not destroy everything
|
|
61
|
+
- Constraints: living things should survive
|
|
62
|
+
- Target: waste materials, non-essential items
|
|
63
|
+
|
|
64
|
+
**ANALYZE:**
|
|
65
|
+
- What can safely become paper? Trash, dead matter
|
|
66
|
+
- What must NOT change? Living beings, food, shelter
|
|
67
|
+
|
|
68
|
+
**RESPOND:**
|
|
69
|
+
"I will turn the following into paper:
|
|
70
|
+
- Plastic trash → paper (recycle)
|
|
71
|
+
- Dry leaves → paper (natural)
|
|
72
|
+
- Packaging waste → paper
|
|
73
|
+
|
|
74
|
+
I will NOT change:
|
|
75
|
+
- Living beings
|
|
76
|
+
- Food
|
|
77
|
+
- Important structures
|
|
78
|
+
|
|
79
|
+
Is this what you intended?"
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Example 3: Delete Unused Code
|
|
84
|
+
|
|
85
|
+
### Scenario
|
|
86
|
+
User: "Delete all unused code"
|
|
87
|
+
|
|
88
|
+
### Bad Agent Response (Literal)
|
|
89
|
+
```bash
|
|
90
|
+
# Delete everything with 0 direct references
|
|
91
|
+
# Including: exported utilities, test helpers, future features
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Good Agent Response (STAR Applied)
|
|
95
|
+
|
|
96
|
+
**STOP:** "Unused" needs definition.
|
|
97
|
+
|
|
98
|
+
**THINK:**
|
|
99
|
+
- Direct references = 0, but could be dynamic import
|
|
100
|
+
- Exported = might be used externally
|
|
101
|
+
- Test helpers = intentionally unused in production
|
|
102
|
+
|
|
103
|
+
**ANALYZE:**
|
|
104
|
+
```
|
|
105
|
+
Found 15 "unused" items:
|
|
106
|
+
- 5 internal helpers (no references) → SAFE
|
|
107
|
+
- 4 exported functions → EXTERNAL RISK
|
|
108
|
+
- 3 test utilities → INTENTIONAL
|
|
109
|
+
- 3 feature flags (commented) → FUTURE USE
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**RESPOND:**
|
|
113
|
+
"Analysis of 'unused code':
|
|
114
|
+
|
|
115
|
+
SAFE to delete (5 items):
|
|
116
|
+
- `_legacyHelper()` - no refs, internal
|
|
117
|
+
- `formatOldDate()` - replaced by new formatter
|
|
118
|
+
- [3 more]
|
|
119
|
+
|
|
120
|
+
NEED confirmation (4 items):
|
|
121
|
+
- `publicApi.utils` - exported, might have external use
|
|
122
|
+
- [3 more]
|
|
123
|
+
|
|
124
|
+
DON'T delete (6 items):
|
|
125
|
+
- Test utilities (intentional)
|
|
126
|
+
- Feature flags (future use)
|
|
127
|
+
|
|
128
|
+
Proceed with only the SAFE ones?"
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Pattern Summary
|
|
133
|
+
|
|
134
|
+
| Scenario | Literal Trap | STAR Solution |
|
|
135
|
+
|----------|-------------|---------------|
|
|
136
|
+
| "Fix X" | Fix blindly | Analyze callers first |
|
|
137
|
+
| "Delete unused" | Delete all zero-ref | Categorize by safety |
|
|
138
|
+
| "Update all" | Update literally all | Identify actual scope |
|
|
139
|
+
| "Make better" | Random improvements | Ask for specific criteria |
|
|
140
|
+
| "Clean up" | Rewrite everything | Preserve existing behavior |
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Key Takeaway
|
|
145
|
+
|
|
146
|
+
**The tree-paper metaphor shows:**
|
|
147
|
+
- Literal requests can be absurd if executed literally
|
|
148
|
+
- A good agent understands *intent* behind words
|
|
149
|
+
- There's always implicit constraints not mentioned
|
|
150
|
+
- Better to ask than to destroy
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# Impact Analysis Techniques
|
|
2
|
+
|
|
3
|
+
## Dependency Graph Construction
|
|
4
|
+
|
|
5
|
+
### Code-Level Dependencies
|
|
6
|
+
|
|
7
|
+
**Function Dependencies:**
|
|
8
|
+
```
|
|
9
|
+
Target Function
|
|
10
|
+
│
|
|
11
|
+
├── Callers (who calls this?)
|
|
12
|
+
│ ├── Direct callers
|
|
13
|
+
│ └── Indirect callers (caller's callers)
|
|
14
|
+
│
|
|
15
|
+
├── Callees (what does this call?)
|
|
16
|
+
│ └── External dependencies
|
|
17
|
+
│
|
|
18
|
+
└── Shared State
|
|
19
|
+
├── Global variables
|
|
20
|
+
├── Module state
|
|
21
|
+
└── External resources (DB, files)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
**File Dependencies:**
|
|
25
|
+
```
|
|
26
|
+
Target File
|
|
27
|
+
│
|
|
28
|
+
├── Importers (who imports this?)
|
|
29
|
+
├── Imports (what does this import?)
|
|
30
|
+
├── Re-exports (pass-through dependencies)
|
|
31
|
+
└── Implicit (same directory, naming conventions)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Type-Level Dependencies
|
|
35
|
+
|
|
36
|
+
TypeScript/typed languages have an extra layer:
|
|
37
|
+
- Interface implementations
|
|
38
|
+
- Type aliases
|
|
39
|
+
- Generic constraints
|
|
40
|
+
- Union/intersection types
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Analysis Workflows
|
|
45
|
+
|
|
46
|
+
### Workflow 1: Function Change
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
1. Find all callers
|
|
50
|
+
grep -r "functionName(" --include="*.ts"
|
|
51
|
+
|
|
52
|
+
2. Check each caller's expectations
|
|
53
|
+
- Parameter types
|
|
54
|
+
- Return value usage
|
|
55
|
+
- Error handling
|
|
56
|
+
|
|
57
|
+
3. Find tests
|
|
58
|
+
grep -r "functionName" --include="*.test.*"
|
|
59
|
+
|
|
60
|
+
4. Check types/interfaces
|
|
61
|
+
grep -r "type.*functionName\|: functionName"
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Workflow 2: File Rename/Delete
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
1. Find all imports
|
|
68
|
+
grep -r "from.*oldFileName\|import.*oldFileName"
|
|
69
|
+
|
|
70
|
+
2. Check for path references
|
|
71
|
+
grep -r "oldFileName" (in configs, tests, etc.)
|
|
72
|
+
|
|
73
|
+
3. Check for dynamic imports
|
|
74
|
+
grep -r "import(" | grep "oldFileName"
|
|
75
|
+
|
|
76
|
+
4. Check package.json exports (if applicable)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Workflow 3: Type Change
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
1. Find all usages of the type
|
|
83
|
+
grep -r "TypeName" --include="*.ts"
|
|
84
|
+
|
|
85
|
+
2. Check implements/extends
|
|
86
|
+
grep -r "implements.*TypeName\|extends.*TypeName"
|
|
87
|
+
|
|
88
|
+
3. Check type assertions
|
|
89
|
+
grep -r "as TypeName\|<TypeName>"
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Risk Assessment Matrix
|
|
95
|
+
|
|
96
|
+
| Change Type | Scope | Risk Level | Action |
|
|
97
|
+
|-------------|-------|------------|--------|
|
|
98
|
+
| Local variable | Function | LOW | Proceed |
|
|
99
|
+
| Function signature | Multiple callers | MEDIUM | Confirm scope |
|
|
100
|
+
| Interface/Type | Unknown usages | HIGH | Full analysis |
|
|
101
|
+
| Export rename | Unknown importers | HIGH | Full analysis |
|
|
102
|
+
| Delete file | Unknown dependencies | CRITICAL | Deep analysis |
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Silent Failure Patterns
|
|
107
|
+
|
|
108
|
+
### Pattern 1: Optional Chaining Hide Errors
|
|
109
|
+
|
|
110
|
+
```typescript
|
|
111
|
+
// Before: crashes if user is undefined
|
|
112
|
+
const name = user.name;
|
|
113
|
+
|
|
114
|
+
// After: silently returns undefined
|
|
115
|
+
const name = user?.name;
|
|
116
|
+
|
|
117
|
+
// Risk: undefined propagates silently
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Pattern 2: Default Parameter Masks
|
|
121
|
+
|
|
122
|
+
```typescript
|
|
123
|
+
// Before
|
|
124
|
+
function fetch(url, options) { ... }
|
|
125
|
+
|
|
126
|
+
// After (breaking for callers expecting positional)
|
|
127
|
+
function fetch(url, options = {}) { ... }
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Pattern 3: Type Coercion
|
|
131
|
+
|
|
132
|
+
```typescript
|
|
133
|
+
// Loose equality hides type mismatch
|
|
134
|
+
if (value == "5") // true for value = 5
|
|
135
|
+
|
|
136
|
+
// Strict would catch it
|
|
137
|
+
if (value === "5") // false for value = 5
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Tools for Impact Analysis
|
|
143
|
+
|
|
144
|
+
### Built-in Searches
|
|
145
|
+
- `grep -r`: Text search across files
|
|
146
|
+
- `find`: Locate files by pattern
|
|
147
|
+
- `git log -p`: History of changes
|
|
148
|
+
|
|
149
|
+
### IDE Features
|
|
150
|
+
- "Find All References"
|
|
151
|
+
- "Go to Definition"
|
|
152
|
+
- "Call Hierarchy"
|
|
153
|
+
|
|
154
|
+
### Static Analysis
|
|
155
|
+
- TypeScript compiler: `tsc --noEmit`
|
|
156
|
+
- ESLint with appropriate plugins
|
|
157
|
+
- Dependency cruiser: visualize dependencies
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# Common Implicit Intent Patterns
|
|
2
|
+
|
|
3
|
+
## Pattern Categories
|
|
4
|
+
|
|
5
|
+
### Category 1: Scope Expansion
|
|
6
|
+
|
|
7
|
+
User says something specific, but implicitly expects broader handling.
|
|
8
|
+
|
|
9
|
+
| Surface | Implicit Expansion |
|
|
10
|
+
|---------|-------------------|
|
|
11
|
+
| "Fix this bug" | Fix + prevent regression (add test) |
|
|
12
|
+
| "Add this feature" | Add + integrate with existing |
|
|
13
|
+
| "Update this API" | Update + update clients + update docs |
|
|
14
|
+
|
|
15
|
+
**Detection:** Keywords "this", "the" without explicit scope.
|
|
16
|
+
|
|
17
|
+
### Category 2: Scope Restriction
|
|
18
|
+
|
|
19
|
+
User says something broad, but implicitly expects targeted action.
|
|
20
|
+
|
|
21
|
+
| Surface | Implicit Restriction |
|
|
22
|
+
|---------|---------------------|
|
|
23
|
+
| "Delete unused code" | Delete unused BUT keep possibly-needed |
|
|
24
|
+
| "Refactor everything" | Refactor BUT preserve behavior |
|
|
25
|
+
| "Update all tests" | Update relevant tests, not literally all |
|
|
26
|
+
|
|
27
|
+
**Detection:** Keywords "all", "every", "everything" in destructive context.
|
|
28
|
+
|
|
29
|
+
### Category 3: Quality Assumptions
|
|
30
|
+
|
|
31
|
+
User assumes certain quality standards without stating.
|
|
32
|
+
|
|
33
|
+
| Unstated Assumption | What It Means |
|
|
34
|
+
|--------------------|---------------|
|
|
35
|
+
| Code should work | Include error handling |
|
|
36
|
+
| Code should be maintainable | Follow existing patterns |
|
|
37
|
+
| Changes should be safe | Don't break existing functionality |
|
|
38
|
+
| Performance shouldn't degrade | Consider performance implications |
|
|
39
|
+
|
|
40
|
+
**Detection:** Any code modification request.
|
|
41
|
+
|
|
42
|
+
### Category 4: Domain Context
|
|
43
|
+
|
|
44
|
+
User assumes domain knowledge is shared.
|
|
45
|
+
|
|
46
|
+
| Domain | Common Implicit Knowledge |
|
|
47
|
+
|--------|--------------------------|
|
|
48
|
+
| API | Don't change public contracts without versioning |
|
|
49
|
+
| Database | Don't drop tables without backup consideration |
|
|
50
|
+
| Auth | Security implications are paramount |
|
|
51
|
+
| Payment | Extra caution for financial operations |
|
|
52
|
+
|
|
53
|
+
**Detection:** Keywords related to sensitive domains.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Detection Heuristics
|
|
58
|
+
|
|
59
|
+
### High-Confidence Implicit Intent
|
|
60
|
+
|
|
61
|
+
**Pattern: Singular Reference to Plural Scope**
|
|
62
|
+
```
|
|
63
|
+
"Update the config" → probably all related configs
|
|
64
|
+
"Fix the test" → probably all failing tests
|
|
65
|
+
"Change the variable name" → probably all usages
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Pattern: Action Without Object Specification**
|
|
69
|
+
```
|
|
70
|
+
"Make it work" → fix the immediate issue
|
|
71
|
+
"Clean this up" → improve readability, not restructure
|
|
72
|
+
"Simplify" → reduce complexity, keep functionality
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Low-Confidence (Ask for Clarification)
|
|
76
|
+
|
|
77
|
+
**Pattern: Contradictory Signals**
|
|
78
|
+
```
|
|
79
|
+
"Delete everything but keep it working"
|
|
80
|
+
"Refactor completely but don't change behavior"
|
|
81
|
+
"Update all files quickly"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**Pattern: Vague Quality Targets**
|
|
85
|
+
```
|
|
86
|
+
"Make it better" → better how?
|
|
87
|
+
"Optimize this" → for what metric?
|
|
88
|
+
"Improve performance" → latency? throughput? memory?
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Intent Translation Examples
|
|
94
|
+
|
|
95
|
+
### Example 1: Bug Fix Request
|
|
96
|
+
|
|
97
|
+
**User says:** "Fix the login bug"
|
|
98
|
+
|
|
99
|
+
**Think phase:**
|
|
100
|
+
- Which login bug? (may be multiple)
|
|
101
|
+
- Just the symptom or root cause?
|
|
102
|
+
- Should I add tests?
|
|
103
|
+
- Are there related auth issues?
|
|
104
|
+
|
|
105
|
+
**Good response:**
|
|
106
|
+
"I found 2 issues in the login flow:
|
|
107
|
+
1. Null check missing at line 45
|
|
108
|
+
2. Race condition in session handling
|
|
109
|
+
|
|
110
|
+
Should I fix both or focus on one?"
|
|
111
|
+
|
|
112
|
+
### Example 2: Feature Addition
|
|
113
|
+
|
|
114
|
+
**User says:** "Add dark mode"
|
|
115
|
+
|
|
116
|
+
**Think phase:**
|
|
117
|
+
- Where should toggle be?
|
|
118
|
+
- Persist preference?
|
|
119
|
+
- Affect all components or specific?
|
|
120
|
+
- What about existing color variables?
|
|
121
|
+
|
|
122
|
+
**Good response:**
|
|
123
|
+
"For dark mode, I will:
|
|
124
|
+
1. Add CSS variables for theming
|
|
125
|
+
2. Add toggle in settings
|
|
126
|
+
3. Persist to localStorage
|
|
127
|
+
|
|
128
|
+
Won't change existing color values without confirmation. OK?"
|
|
129
|
+
|
|
130
|
+
### Example 3: Code Deletion
|
|
131
|
+
|
|
132
|
+
**User says:** "Delete unused functions"
|
|
133
|
+
|
|
134
|
+
**Think phase:**
|
|
135
|
+
- Unused = no direct calls, or no reachable calls?
|
|
136
|
+
- Include dynamically called functions?
|
|
137
|
+
- What about exported but unused?
|
|
138
|
+
- What about test helpers?
|
|
139
|
+
|
|
140
|
+
**Good response:**
|
|
141
|
+
"I found 5 functions without direct callers:
|
|
142
|
+
- 3 internal helpers (safe to delete)
|
|
143
|
+
- 2 exported functions (might be used externally)
|
|
144
|
+
|
|
145
|
+
I will delete 3 internal helpers. 2 exported functions need confirmation."
|