xtep-workspace 1.10.10
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/CHANGELOG.md +525 -0
- package/README.md +188 -0
- package/config/component-versions.json +16 -0
- package/config/scenarioCapabilities.json +29 -0
- package/config/version-notes.yaml +244 -0
- package/dist/adapters/OutputAdapter.d.ts +79 -0
- package/dist/adapters/OutputAdapter.d.ts.map +1 -0
- package/dist/adapters/OutputAdapter.js +124 -0
- package/dist/adapters/OutputAdapter.js.map +1 -0
- package/dist/cli/check-node-version.d.ts +3 -0
- package/dist/cli/check-node-version.d.ts.map +1 -0
- package/dist/cli/check-node-version.js +153 -0
- package/dist/cli/check-node-version.js.map +1 -0
- package/dist/cli/plugins.d.ts +41 -0
- package/dist/cli/plugins.d.ts.map +1 -0
- package/dist/cli/plugins.js +742 -0
- package/dist/cli/plugins.js.map +1 -0
- package/dist/cli/rebuild.d.ts +63 -0
- package/dist/cli/rebuild.d.ts.map +1 -0
- package/dist/cli/rebuild.js +989 -0
- package/dist/cli/rebuild.js.map +1 -0
- package/dist/cli/repair.d.ts +7 -0
- package/dist/cli/repair.d.ts.map +1 -0
- package/dist/cli/repair.js +925 -0
- package/dist/cli/repair.js.map +1 -0
- package/dist/cli/setup.d.ts +7 -0
- package/dist/cli/setup.d.ts.map +1 -0
- package/dist/cli/setup.js +452 -0
- package/dist/cli/setup.js.map +1 -0
- package/dist/cli/update.d.ts +10 -0
- package/dist/cli/update.d.ts.map +1 -0
- package/dist/cli/update.js +426 -0
- package/dist/cli/update.js.map +1 -0
- package/dist/cli/webui.d.ts +6 -0
- package/dist/cli/webui.d.ts.map +1 -0
- package/dist/cli/webui.js +210 -0
- package/dist/cli/webui.js.map +1 -0
- package/dist/http/index.d.ts +3 -0
- package/dist/http/index.d.ts.map +1 -0
- package/dist/http/index.js +15 -0
- package/dist/http/index.js.map +1 -0
- package/dist/http/middleware/errorHandler.d.ts +16 -0
- package/dist/http/middleware/errorHandler.d.ts.map +1 -0
- package/dist/http/middleware/errorHandler.js +79 -0
- package/dist/http/middleware/errorHandler.js.map +1 -0
- package/dist/http/routes/admin.d.ts +3 -0
- package/dist/http/routes/admin.d.ts.map +1 -0
- package/dist/http/routes/admin.js +730 -0
- package/dist/http/routes/admin.js.map +1 -0
- package/dist/http/routes/backup.d.ts +3 -0
- package/dist/http/routes/backup.d.ts.map +1 -0
- package/dist/http/routes/backup.js +172 -0
- package/dist/http/routes/backup.js.map +1 -0
- package/dist/http/routes/config.d.ts +3 -0
- package/dist/http/routes/config.d.ts.map +1 -0
- package/dist/http/routes/config.js +157 -0
- package/dist/http/routes/config.js.map +1 -0
- package/dist/http/routes/context.d.ts +3 -0
- package/dist/http/routes/context.d.ts.map +1 -0
- package/dist/http/routes/context.js +82 -0
- package/dist/http/routes/context.js.map +1 -0
- package/dist/http/routes/log.d.ts +3 -0
- package/dist/http/routes/log.d.ts.map +1 -0
- package/dist/http/routes/log.js +105 -0
- package/dist/http/routes/log.js.map +1 -0
- package/dist/http/routes/memo.d.ts +6 -0
- package/dist/http/routes/memo.d.ts.map +1 -0
- package/dist/http/routes/memo.js +29 -0
- package/dist/http/routes/memo.js.map +1 -0
- package/dist/http/routes/node.d.ts +3 -0
- package/dist/http/routes/node.d.ts.map +1 -0
- package/dist/http/routes/node.js +251 -0
- package/dist/http/routes/node.js.map +1 -0
- package/dist/http/routes/state.d.ts +3 -0
- package/dist/http/routes/state.d.ts.map +1 -0
- package/dist/http/routes/state.js +48 -0
- package/dist/http/routes/state.js.map +1 -0
- package/dist/http/routes/workspace.d.ts +3 -0
- package/dist/http/routes/workspace.d.ts.map +1 -0
- package/dist/http/routes/workspace.js +249 -0
- package/dist/http/routes/workspace.js.map +1 -0
- package/dist/http/server.d.ts +10 -0
- package/dist/http/server.d.ts.map +1 -0
- package/dist/http/server.js +284 -0
- package/dist/http/server.js.map +1 -0
- package/dist/http/services.d.ts +93 -0
- package/dist/http/services.d.ts.map +1 -0
- package/dist/http/services.js +297 -0
- package/dist/http/services.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1073 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts/guidanceContent.d.ts +18 -0
- package/dist/prompts/guidanceContent.d.ts.map +1 -0
- package/dist/prompts/guidanceContent.js +814 -0
- package/dist/prompts/guidanceContent.js.map +1 -0
- package/dist/prompts/index.d.ts +2 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +4 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/prompts/instructions.d.ts +56 -0
- package/dist/prompts/instructions.d.ts.map +1 -0
- package/dist/prompts/instructions.js +1343 -0
- package/dist/prompts/instructions.js.map +1 -0
- package/dist/services/BackupService.d.ts +104 -0
- package/dist/services/BackupService.d.ts.map +1 -0
- package/dist/services/BackupService.js +549 -0
- package/dist/services/BackupService.js.map +1 -0
- package/dist/services/CapabilityService.d.ts +38 -0
- package/dist/services/CapabilityService.d.ts.map +1 -0
- package/dist/services/CapabilityService.js +256 -0
- package/dist/services/CapabilityService.js.map +1 -0
- package/dist/services/ConfigService.d.ts +35 -0
- package/dist/services/ConfigService.d.ts.map +1 -0
- package/dist/services/ConfigService.js +105 -0
- package/dist/services/ConfigService.js.map +1 -0
- package/dist/services/ContextService.d.ts +65 -0
- package/dist/services/ContextService.d.ts.map +1 -0
- package/dist/services/ContextService.js +503 -0
- package/dist/services/ContextService.js.map +1 -0
- package/dist/services/DetectionService.d.ts +76 -0
- package/dist/services/DetectionService.d.ts.map +1 -0
- package/dist/services/DetectionService.js +262 -0
- package/dist/services/DetectionService.js.map +1 -0
- package/dist/services/DispatchService.d.ts +267 -0
- package/dist/services/DispatchService.d.ts.map +1 -0
- package/dist/services/DispatchService.js +1357 -0
- package/dist/services/DispatchService.js.map +1 -0
- package/dist/services/EventService.d.ts +81 -0
- package/dist/services/EventService.d.ts.map +1 -0
- package/dist/services/EventService.js +187 -0
- package/dist/services/EventService.js.map +1 -0
- package/dist/services/GuidanceService.d.ts +64 -0
- package/dist/services/GuidanceService.d.ts.map +1 -0
- package/dist/services/GuidanceService.js +259 -0
- package/dist/services/GuidanceService.js.map +1 -0
- package/dist/services/HealthService.d.ts +43 -0
- package/dist/services/HealthService.d.ts.map +1 -0
- package/dist/services/HealthService.js +276 -0
- package/dist/services/HealthService.js.map +1 -0
- package/dist/services/InstallationService.d.ts +62 -0
- package/dist/services/InstallationService.d.ts.map +1 -0
- package/dist/services/InstallationService.js +204 -0
- package/dist/services/InstallationService.js.map +1 -0
- package/dist/services/LogService.d.ts +35 -0
- package/dist/services/LogService.d.ts.map +1 -0
- package/dist/services/LogService.js +189 -0
- package/dist/services/LogService.js.map +1 -0
- package/dist/services/MemoService.d.ts +39 -0
- package/dist/services/MemoService.d.ts.map +1 -0
- package/dist/services/MemoService.js +288 -0
- package/dist/services/MemoService.js.map +1 -0
- package/dist/services/NodeService.d.ts +90 -0
- package/dist/services/NodeService.d.ts.map +1 -0
- package/dist/services/NodeService.js +958 -0
- package/dist/services/NodeService.js.map +1 -0
- package/dist/services/OpenSpecParser.d.ts +43 -0
- package/dist/services/OpenSpecParser.d.ts.map +1 -0
- package/dist/services/OpenSpecParser.js +191 -0
- package/dist/services/OpenSpecParser.js.map +1 -0
- package/dist/services/ReferenceService.d.ts +35 -0
- package/dist/services/ReferenceService.d.ts.map +1 -0
- package/dist/services/ReferenceService.js +195 -0
- package/dist/services/ReferenceService.js.map +1 -0
- package/dist/services/RepairService.d.ts +36 -0
- package/dist/services/RepairService.d.ts.map +1 -0
- package/dist/services/RepairService.js +429 -0
- package/dist/services/RepairService.js.map +1 -0
- package/dist/services/SearchService.d.ts +34 -0
- package/dist/services/SearchService.d.ts.map +1 -0
- package/dist/services/SearchService.js +293 -0
- package/dist/services/SearchService.js.map +1 -0
- package/dist/services/SessionService.d.ts +136 -0
- package/dist/services/SessionService.d.ts.map +1 -0
- package/dist/services/SessionService.js +297 -0
- package/dist/services/SessionService.js.map +1 -0
- package/dist/services/StateService.d.ts +97 -0
- package/dist/services/StateService.d.ts.map +1 -0
- package/dist/services/StateService.js +846 -0
- package/dist/services/StateService.js.map +1 -0
- package/dist/services/TutorialService.d.ts +114 -0
- package/dist/services/TutorialService.d.ts.map +1 -0
- package/dist/services/TutorialService.js +1262 -0
- package/dist/services/TutorialService.js.map +1 -0
- package/dist/services/WorkspaceService.d.ts +273 -0
- package/dist/services/WorkspaceService.d.ts.map +1 -0
- package/dist/services/WorkspaceService.js +1764 -0
- package/dist/services/WorkspaceService.js.map +1 -0
- package/dist/services/index.d.ts +15 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +14 -0
- package/dist/services/index.js.map +1 -0
- package/dist/storage/FileSystemAdapter.d.ts +223 -0
- package/dist/storage/FileSystemAdapter.d.ts.map +1 -0
- package/dist/storage/FileSystemAdapter.js +384 -0
- package/dist/storage/FileSystemAdapter.js.map +1 -0
- package/dist/storage/JsonStorage.d.ts +158 -0
- package/dist/storage/JsonStorage.d.ts.map +1 -0
- package/dist/storage/JsonStorage.js +613 -0
- package/dist/storage/JsonStorage.js.map +1 -0
- package/dist/storage/MarkdownStorage.d.ts +178 -0
- package/dist/storage/MarkdownStorage.d.ts.map +1 -0
- package/dist/storage/MarkdownStorage.js +918 -0
- package/dist/storage/MarkdownStorage.js.map +1 -0
- package/dist/storage/SessionBindingStorage.d.ts +69 -0
- package/dist/storage/SessionBindingStorage.d.ts.map +1 -0
- package/dist/storage/SessionBindingStorage.js +131 -0
- package/dist/storage/SessionBindingStorage.js.map +1 -0
- package/dist/storage/index.d.ts +6 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +6 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/tools/capability.d.ts +18 -0
- package/dist/tools/capability.d.ts.map +1 -0
- package/dist/tools/capability.js +73 -0
- package/dist/tools/capability.js.map +1 -0
- package/dist/tools/config.d.ts +14 -0
- package/dist/tools/config.d.ts.map +1 -0
- package/dist/tools/config.js +61 -0
- package/dist/tools/config.js.map +1 -0
- package/dist/tools/context.d.ts +22 -0
- package/dist/tools/context.d.ts.map +1 -0
- package/dist/tools/context.js +139 -0
- package/dist/tools/context.js.map +1 -0
- package/dist/tools/dispatch.d.ts +41 -0
- package/dist/tools/dispatch.d.ts.map +1 -0
- package/dist/tools/dispatch.js +380 -0
- package/dist/tools/dispatch.js.map +1 -0
- package/dist/tools/help.d.ts +44 -0
- package/dist/tools/help.d.ts.map +1 -0
- package/dist/tools/help.js +227 -0
- package/dist/tools/help.js.map +1 -0
- package/dist/tools/import.d.ts +17 -0
- package/dist/tools/import.d.ts.map +1 -0
- package/dist/tools/import.js +96 -0
- package/dist/tools/import.js.map +1 -0
- package/dist/tools/index.d.ts +12 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +13 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/log.d.ts +21 -0
- package/dist/tools/log.d.ts.map +1 -0
- package/dist/tools/log.js +93 -0
- package/dist/tools/log.js.map +1 -0
- package/dist/tools/memo.d.ts +26 -0
- package/dist/tools/memo.d.ts.map +1 -0
- package/dist/tools/memo.js +188 -0
- package/dist/tools/memo.js.map +1 -0
- package/dist/tools/node.d.ts +34 -0
- package/dist/tools/node.d.ts.map +1 -0
- package/dist/tools/node.js +328 -0
- package/dist/tools/node.js.map +1 -0
- package/dist/tools/search.d.ts +14 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +95 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/session.d.ts +22 -0
- package/dist/tools/session.d.ts.map +1 -0
- package/dist/tools/session.js +127 -0
- package/dist/tools/session.js.map +1 -0
- package/dist/tools/state.d.ts +10 -0
- package/dist/tools/state.d.ts.map +1 -0
- package/dist/tools/state.js +79 -0
- package/dist/tools/state.js.map +1 -0
- package/dist/tools/workspace.d.ts +38 -0
- package/dist/tools/workspace.d.ts.map +1 -0
- package/dist/tools/workspace.js +240 -0
- package/dist/tools/workspace.js.map +1 -0
- package/dist/types/capability.d.ts +36 -0
- package/dist/types/capability.d.ts.map +1 -0
- package/dist/types/capability.js +3 -0
- package/dist/types/capability.js.map +1 -0
- package/dist/types/confirmation.d.ts +35 -0
- package/dist/types/confirmation.d.ts.map +1 -0
- package/dist/types/confirmation.js +3 -0
- package/dist/types/confirmation.js.map +1 -0
- package/dist/types/context.d.ts +174 -0
- package/dist/types/context.d.ts.map +1 -0
- package/dist/types/context.js +3 -0
- package/dist/types/context.js.map +1 -0
- package/dist/types/errors.d.ts +81 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/errors.js +154 -0
- package/dist/types/errors.js.map +1 -0
- package/dist/types/guidance.d.ts +162 -0
- package/dist/types/guidance.d.ts.map +1 -0
- package/dist/types/guidance.js +4 -0
- package/dist/types/guidance.js.map +1 -0
- package/dist/types/health.d.ts +61 -0
- package/dist/types/health.d.ts.map +1 -0
- package/dist/types/health.js +3 -0
- package/dist/types/health.js.map +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +11 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/memo.d.ts +132 -0
- package/dist/types/memo.d.ts.map +1 -0
- package/dist/types/memo.js +3 -0
- package/dist/types/memo.js.map +1 -0
- package/dist/types/node.d.ts +316 -0
- package/dist/types/node.d.ts.map +1 -0
- package/dist/types/node.js +3 -0
- package/dist/types/node.js.map +1 -0
- package/dist/types/repair.d.ts +62 -0
- package/dist/types/repair.d.ts.map +1 -0
- package/dist/types/repair.js +4 -0
- package/dist/types/repair.js.map +1 -0
- package/dist/types/search.d.ts +58 -0
- package/dist/types/search.d.ts.map +1 -0
- package/dist/types/search.js +3 -0
- package/dist/types/search.js.map +1 -0
- package/dist/types/settings.d.ts +109 -0
- package/dist/types/settings.d.ts.map +1 -0
- package/dist/types/settings.js +30 -0
- package/dist/types/settings.js.map +1 -0
- package/dist/types/workspace.d.ts +357 -0
- package/dist/types/workspace.d.ts.map +1 -0
- package/dist/types/workspace.js +3 -0
- package/dist/types/workspace.js.map +1 -0
- package/dist/utils/contentValidation.d.ts +47 -0
- package/dist/utils/contentValidation.d.ts.map +1 -0
- package/dist/utils/contentValidation.js +93 -0
- package/dist/utils/contentValidation.js.map +1 -0
- package/dist/utils/devLog.d.ts +43 -0
- package/dist/utils/devLog.d.ts.map +1 -0
- package/dist/utils/devLog.js +94 -0
- package/dist/utils/devLog.js.map +1 -0
- package/dist/utils/errorLogger.d.ts +27 -0
- package/dist/utils/errorLogger.d.ts.map +1 -0
- package/dist/utils/errorLogger.js +105 -0
- package/dist/utils/errorLogger.js.map +1 -0
- package/dist/utils/git.d.ts +123 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +400 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/hash.d.ts +32 -0
- package/dist/utils/hash.d.ts.map +1 -0
- package/dist/utils/hash.js +37 -0
- package/dist/utils/hash.js.map +1 -0
- package/dist/utils/id.d.ts +54 -0
- package/dist/utils/id.d.ts.map +1 -0
- package/dist/utils/id.js +96 -0
- package/dist/utils/id.js.map +1 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +9 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logger.d.ts +42 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +228 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/manualChangeFormatter.d.ts +8 -0
- package/dist/utils/manualChangeFormatter.d.ts.map +1 -0
- package/dist/utils/manualChangeFormatter.js +21 -0
- package/dist/utils/manualChangeFormatter.js.map +1 -0
- package/dist/utils/paramValidator.d.ts +35 -0
- package/dist/utils/paramValidator.d.ts.map +1 -0
- package/dist/utils/paramValidator.js +214 -0
- package/dist/utils/paramValidator.js.map +1 -0
- package/dist/utils/port.d.ts +7 -0
- package/dist/utils/port.d.ts.map +1 -0
- package/dist/utils/port.js +28 -0
- package/dist/utils/port.js.map +1 -0
- package/dist/utils/processManager.d.ts +53 -0
- package/dist/utils/processManager.d.ts.map +1 -0
- package/dist/utils/processManager.js +267 -0
- package/dist/utils/processManager.js.map +1 -0
- package/dist/utils/sessionLogger.d.ts +28 -0
- package/dist/utils/sessionLogger.d.ts.map +1 -0
- package/dist/utils/sessionLogger.js +142 -0
- package/dist/utils/sessionLogger.js.map +1 -0
- package/dist/utils/time.d.ts +15 -0
- package/dist/utils/time.d.ts.map +1 -0
- package/dist/utils/time.js +32 -0
- package/dist/utils/time.js.map +1 -0
- package/dist/utils/validation.d.ts +23 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +88 -0
- package/dist/utils/validation.js.map +1 -0
- package/docs//346/227/245/345/277/227/347/263/273/347/273/237.md +389 -0
- package/docs//347/224/250/346/210/267/346/211/213/345/206/214.md +1446 -0
- package/docs//347/224/250/346/210/267/346/211/213/345/206/214/344/270/216/346/212/200/346/234/257/346/214/207/345/215/227.md +873 -0
- package/package.json +89 -0
- package/plugin/README.md +141 -0
- package/plugin/agents/xtep-executor.md +114 -0
- package/plugin/agents/xtep-reviewer.md +133 -0
- package/plugin/docs/diagnostic-guide.md +128 -0
- package/plugin/hooks/hooks.json.deprecated +70 -0
- package/plugin/scripts/cursor-hook-entry.cjs +217 -0
- package/plugin/scripts/hook-entry.cjs +663 -0
- package/plugin/scripts/openspec-import.cjs +714 -0
- package/plugin/scripts/shared/binding.cjs +98 -0
- package/plugin/scripts/shared/config.cjs +65 -0
- package/plugin/scripts/shared/context.cjs +120 -0
- package/plugin/scripts/shared/index.cjs +34 -0
- package/plugin/scripts/shared/logger.cjs +196 -0
- package/plugin/scripts/shared/reminder.cjs +261 -0
- package/plugin/scripts/shared/utils.cjs +62 -0
- package/plugin/scripts/shared/workspace.cjs +322 -0
- package/plugin/skills/aligning-intent/SKILL.md +275 -0
- package/plugin/skills/analyzing-measurements/SKILL.md +223 -0
- package/plugin/skills/bootstrapping-workspace/SKILL.md +260 -0
- package/plugin/skills/designing-solutions/SKILL.md +363 -0
- package/plugin/skills/diagnosing-issues/SKILL.md +219 -0
- package/plugin/skills/discovering-context/SKILL.md +283 -0
- package/plugin/skills/dispatching-parent/SKILL.md +399 -0
- package/plugin/skills/executing-task/SKILL.md +340 -0
- package/plugin/skills/memo-create/SKILL.md +222 -0
- package/plugin/skills/planning-verification/SKILL.md +245 -0
- package/plugin/skills/preparing-dispatch/SKILL.md +299 -0
- package/plugin/skills/researching-tech/SKILL.md +223 -0
- package/plugin/skills/reviewing-quality/SKILL.md +354 -0
- package/plugin/skills/reviewing-spec/SKILL.md +333 -0
- package/plugin/skills/starting-info-flow/SKILL.md +196 -0
- package/web/README.md +5 -0
- package//351/205/215/347/275/256/346/226/271/345/274/217.md +330 -0
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: diagnosing-issues
|
|
3
|
+
description: Use when debugging errors or investigating performance issues. Traces root cause of problems, applies to logic errors and performance bottlenecks.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Diagnosing Issues
|
|
7
|
+
|
|
8
|
+
## Announcement (MANDATORY)
|
|
9
|
+
|
|
10
|
+
Before executing this skill, you MUST announce to the user:
|
|
11
|
+
|
|
12
|
+
「我将使用 **问题诊断** 技能来追踪问题根因、分析逻辑错误和性能瓶颈。」
|
|
13
|
+
|
|
14
|
+
This creates a commitment checkpoint. Proceed only after announcing.
|
|
15
|
+
|
|
16
|
+
## Core Thinking
|
|
17
|
+
|
|
18
|
+
**Trace** - Follow the causal chain to find root cause.
|
|
19
|
+
|
|
20
|
+
**Recording**: Conversation output is invisible to users. You MUST record to workspace node. Standard: "If context is wiped now, can you recall discussion details from conclusion alone?"
|
|
21
|
+
|
|
22
|
+
**Progressive Recording**: Diagnosis can be long. After each hypothesis test, immediately `log_append` the result. Don't lose valuable debugging insights.
|
|
23
|
+
|
|
24
|
+
## Applicable Scenarios
|
|
25
|
+
|
|
26
|
+
- **Debug**: Diagnose logic errors (why error occurs)
|
|
27
|
+
- **Optimize**: Diagnose performance bottlenecks (why slow)
|
|
28
|
+
|
|
29
|
+
## SOP
|
|
30
|
+
|
|
31
|
+
### 1. Reproduce/Locate
|
|
32
|
+
|
|
33
|
+
#### Debug Scenario
|
|
34
|
+
- Collect error info (message, stack trace, error code)
|
|
35
|
+
- Confirm reproduction steps (always/sometimes, trigger conditions)
|
|
36
|
+
- **Locate code line**: Find code position from error stack
|
|
37
|
+
|
|
38
|
+
#### Optimize Scenario
|
|
39
|
+
- Collect performance data (response time, throughput, resource usage)
|
|
40
|
+
- Identify slow operations (API, DB query, compute-intensive tasks)
|
|
41
|
+
- **Locate bottleneck**: Find slowest function call or SQL
|
|
42
|
+
|
|
43
|
+
### 2. Causal Chain Analysis
|
|
44
|
+
|
|
45
|
+
Build call chain using AST analysis or code tracing:
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
Entry function
|
|
49
|
+
↓ calls
|
|
50
|
+
Intermediate function A
|
|
51
|
+
↓ calls
|
|
52
|
+
Intermediate function B
|
|
53
|
+
↓ calls
|
|
54
|
+
Problem function ← Located point
|
|
55
|
+
↓ trace back
|
|
56
|
+
Data source/Logic flaw ← Root cause
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 3. Hypothesis Testing
|
|
60
|
+
|
|
61
|
+
**Construct hypotheses**:
|
|
62
|
+
- Based on error type, list possible causes
|
|
63
|
+
- Based on performance data, identify potential bottlenecks
|
|
64
|
+
- Priority: Most likely causes first
|
|
65
|
+
|
|
66
|
+
**Verify hypotheses**:
|
|
67
|
+
- Add logging to verify assumptions
|
|
68
|
+
- Modify code to test hypotheses
|
|
69
|
+
- Use debugger to trace execution
|
|
70
|
+
|
|
71
|
+
**⚠️ Checkpoint**: After each hypothesis test, `log_append` the result (confirmed/rejected + evidence).
|
|
72
|
+
|
|
73
|
+
### 4. Root Cause Confirmation
|
|
74
|
+
|
|
75
|
+
**Confirmation criteria**:
|
|
76
|
+
- Can explain all observed symptoms
|
|
77
|
+
- Can reproduce consistently
|
|
78
|
+
- Modification can fix the issue
|
|
79
|
+
|
|
80
|
+
**Output diagnosis report**:
|
|
81
|
+
- Reproduction path
|
|
82
|
+
- Causal chain analysis
|
|
83
|
+
- Root cause location
|
|
84
|
+
- Fix recommendation
|
|
85
|
+
|
|
86
|
+
### 5. Record to Workspace (MANDATORY)
|
|
87
|
+
|
|
88
|
+
After diagnosis, MUST record to workspace node:
|
|
89
|
+
|
|
90
|
+
**Recording locations**:
|
|
91
|
+
| Content | Location | Tool |
|
|
92
|
+
|---------|----------|------|
|
|
93
|
+
| Key conclusions (brief) | conclusion | node_update |
|
|
94
|
+
| Hypotheses, investigation, root cause | notes | node_update |
|
|
95
|
+
| Full trace log (>200 lines) | MEMO | memo_create + node_reference |
|
|
96
|
+
|
|
97
|
+
**NEVER hardcode MEMO IDs** in text like "见 MEMO#xxx". Use `node_reference` to link.
|
|
98
|
+
|
|
99
|
+
**Reference rules** (diagnosis tasks MUST include):
|
|
100
|
+
- Root cause location: `file:line` format (CRITICAL)
|
|
101
|
+
- Error stack trace: key frames with file:line
|
|
102
|
+
- Causal chain: each node with file reference
|
|
103
|
+
- Core principle: precise location enables verification and fix
|
|
104
|
+
|
|
105
|
+
**Conclusion template** (brief):
|
|
106
|
+
```
|
|
107
|
+
[问题描述] + [根因位置] + [修复建议]
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**Notes template** (detailed):
|
|
111
|
+
```
|
|
112
|
+
**Issue**: [error/symptom]
|
|
113
|
+
**Reproduction**: [steps]
|
|
114
|
+
**Investigation**:
|
|
115
|
+
- Hypothesis 1: [tested] → [result]
|
|
116
|
+
- Hypothesis 2: [tested] → [result]
|
|
117
|
+
**Causal Chain**: Entry → A → B → Problem
|
|
118
|
+
**Root Cause**: [file:line] - [explanation]
|
|
119
|
+
**Fix**: [recommendation]
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
**Output**: node_update called with conclusion + notes
|
|
123
|
+
|
|
124
|
+
### 6. Present to User (MANDATORY)
|
|
125
|
+
|
|
126
|
+
After recording, MUST present diagnosis to user:
|
|
127
|
+
|
|
128
|
+
1. **Output summary**: Show root cause and fix recommendation using Output Template
|
|
129
|
+
2. **Wait for confirmation**: Ask user if diagnosis is correct and fix approach is acceptable
|
|
130
|
+
3. **NEVER proceed directly**: Do NOT start fixing without user confirmation
|
|
131
|
+
|
|
132
|
+
**Output**: Diagnosis presented, user confirmation received
|
|
133
|
+
|
|
134
|
+
## Checklist
|
|
135
|
+
|
|
136
|
+
### Debug
|
|
137
|
+
- [ ] Error message collected
|
|
138
|
+
- [ ] Stack trace analyzed
|
|
139
|
+
- [ ] Reproduction steps confirmed
|
|
140
|
+
- [ ] Root cause code located
|
|
141
|
+
- [ ] Fix verified
|
|
142
|
+
|
|
143
|
+
### Optimize
|
|
144
|
+
- [ ] Performance baseline established
|
|
145
|
+
- [ ] Bottleneck identified
|
|
146
|
+
- [ ] Causal chain traced
|
|
147
|
+
- [ ] Optimization point confirmed
|
|
148
|
+
|
|
149
|
+
### Recording (MANDATORY)
|
|
150
|
+
- [ ] **Conclusion written**: Brief summary in node conclusion
|
|
151
|
+
- [ ] **Notes written**: Investigation, root cause in node notes
|
|
152
|
+
- [ ] **MEMO linked**: Long content in MEMO, linked via node_reference (not hardcoded ID)
|
|
153
|
+
- [ ] **Wipe test**: If context wiped now, can recall details from recorded content?
|
|
154
|
+
|
|
155
|
+
### Long Content Protection
|
|
156
|
+
- [ ] **Progressive recording**: Used `log_append` after each hypothesis test
|
|
157
|
+
- [ ] **Root cause referenced**: Location has precise `file:line`
|
|
158
|
+
- [ ] **Causal chain referenced**: Each node has file reference
|
|
159
|
+
|
|
160
|
+
## Output Template
|
|
161
|
+
|
|
162
|
+
```markdown
|
|
163
|
+
### Diagnosis Summary
|
|
164
|
+
**Issue type**: [Error/Performance]
|
|
165
|
+
**Root cause**: [One sentence description]
|
|
166
|
+
**Location**: [file:line]
|
|
167
|
+
|
|
168
|
+
### Reproduction Path
|
|
169
|
+
1. [Step 1]
|
|
170
|
+
2. [Step 2]
|
|
171
|
+
3. [Symptom appears]
|
|
172
|
+
|
|
173
|
+
### Causal Chain
|
|
174
|
+
[Entry] → [Function A] → [Function B] → [Problem point]
|
|
175
|
+
|
|
176
|
+
### Root Cause Analysis
|
|
177
|
+
[Detailed explanation of why this causes the issue]
|
|
178
|
+
|
|
179
|
+
### Fix Recommendation
|
|
180
|
+
[Specific fix approach]
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## Red Flags
|
|
184
|
+
|
|
185
|
+
1. **Fix symptoms not cause** - Patch visible error without finding root cause
|
|
186
|
+
2. **Skip reproduction** - Assume issue without consistent reproduction
|
|
187
|
+
3. **Single hypothesis** - Lock on first guess without exploring alternatives
|
|
188
|
+
4. **No verification** - Claim fix without testing
|
|
189
|
+
5. **Silent execution** - Complete diagnosis, then immediately start fixing without showing user
|
|
190
|
+
6. **Vague location** - "The problem is in module X" without `file:line`
|
|
191
|
+
7. **Lost hypotheses** - Test multiple hypotheses without logging results
|
|
192
|
+
|
|
193
|
+
## Mandatory Rules
|
|
194
|
+
|
|
195
|
+
1. **MUST reproduce first** - NEVER attempt fix without consistent reproduction
|
|
196
|
+
2. **MUST find root cause** - Fixing symptoms without root cause leads to recurrence
|
|
197
|
+
3. **MUST test one hypothesis at a time** - Multiple simultaneous changes = no learning
|
|
198
|
+
4. **MUST verify the fix** - "Should work" is not verification
|
|
199
|
+
5. **NEVER blame user/environment** - Reproduce in user's conditions first
|
|
200
|
+
6. **MUST present before proceed** - After diagnosis, NEVER start fixing directly. Present diagnosis, wait for user confirmation
|
|
201
|
+
|
|
202
|
+
## Anti-Patterns
|
|
203
|
+
|
|
204
|
+
| Pattern | Wrong | Right |
|
|
205
|
+
|---------|-------|-------|
|
|
206
|
+
| **Guess and fix** | Try random fixes hoping one works | Systematic hypothesis testing |
|
|
207
|
+
| **Blame user** | "Works on my machine" | Reproduce in user environment |
|
|
208
|
+
| **Ignore edge cases** | Only test happy path | Test error scenarios too |
|
|
209
|
+
| **Incomplete trace** | Stop at first error | Trace to true root cause |
|
|
210
|
+
|
|
211
|
+
## Common Rationalizations
|
|
212
|
+
|
|
213
|
+
| Excuse | Why Wrong | Correct Action |
|
|
214
|
+
|--------|-----------|----------------|
|
|
215
|
+
| "The fix is obvious" | Obvious fixes often miss root cause | Trace causal chain first |
|
|
216
|
+
| "It only happens sometimes" | Intermittent bugs need systematic reproduction | Find trigger conditions |
|
|
217
|
+
| "Adding a retry will fix it" | Retry masks the real problem | Find why it fails, then fix |
|
|
218
|
+
| "Let me try this quick fix first" | Quick fixes compound into technical debt | Diagnose properly, fix once |
|
|
219
|
+
| "I've seen this before" | Similar symptoms may have different causes | Verify with evidence, don't assume |
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: discovering-context
|
|
3
|
+
description: Use when starting work on unfamiliar codebase or module. Investigates project context, understands existing state and dependencies.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Discovering Context
|
|
7
|
+
|
|
8
|
+
## Announcement (MANDATORY)
|
|
9
|
+
|
|
10
|
+
Before executing this skill, you MUST announce to the user:
|
|
11
|
+
|
|
12
|
+
「我将使用 **上下文探索** 技能来调查项目背景、理解现有状态和依赖关系。」
|
|
13
|
+
|
|
14
|
+
This creates a commitment checkpoint. Proceed only after announcing.
|
|
15
|
+
|
|
16
|
+
## Core Thinking
|
|
17
|
+
|
|
18
|
+
**Investigate** - Build cognitive model through systematic information collection.
|
|
19
|
+
|
|
20
|
+
**Recording**: Conversation output is invisible to users. You MUST record to workspace node. Standard: "If context is wiped now, can you recall discussion details from conclusion alone?"
|
|
21
|
+
|
|
22
|
+
**Progressive Recording**: For long explorations, NEVER wait until the end to record. After each major discovery, immediately `log_append` key findings. Context may be lost at any time.
|
|
23
|
+
|
|
24
|
+
## Typical Actions
|
|
25
|
+
|
|
26
|
+
- **Explore codebase**: Use Task tool with `subagent_type=Explore` for complex exploration
|
|
27
|
+
- Search code: Use Grep/Glob for targeted keyword search
|
|
28
|
+
- Read docs: Scan README, design docs, API docs
|
|
29
|
+
- Trace dependencies: Analyze module relationships, data flow
|
|
30
|
+
|
|
31
|
+
## When to Use Explore Agent
|
|
32
|
+
|
|
33
|
+
**PREFER Explore agent** for open-ended exploration:
|
|
34
|
+
- "Where is X implemented?"
|
|
35
|
+
- "How does the codebase handle Y?"
|
|
36
|
+
- "Find all files related to Z"
|
|
37
|
+
|
|
38
|
+
**Use Grep/Glob directly** for targeted search:
|
|
39
|
+
- Specific class/function name
|
|
40
|
+
- Known file pattern
|
|
41
|
+
- Simple keyword lookup
|
|
42
|
+
|
|
43
|
+
## Strategy Selection
|
|
44
|
+
|
|
45
|
+
### Macro (Document-first)
|
|
46
|
+
- **Use when**: New project, architecture design, requirements analysis
|
|
47
|
+
- **Sources**: README, docs/, architecture diagrams, CHANGELOG
|
|
48
|
+
- **Goal**: Understand overall design, business logic, module structure
|
|
49
|
+
|
|
50
|
+
### Micro (Code-first)
|
|
51
|
+
- **Use when**: Bug fixing, feature extension, code refactoring
|
|
52
|
+
- **Sources**: Source code, type definitions, test cases
|
|
53
|
+
- **Goal**: Understand implementation, data flow, call chains
|
|
54
|
+
|
|
55
|
+
**Decision rules**:
|
|
56
|
+
- Architecture design → Macro
|
|
57
|
+
- Specific implementation → Micro
|
|
58
|
+
- New domain → Macro first, then Micro deep dive
|
|
59
|
+
- Clear local scope → Micro first
|
|
60
|
+
|
|
61
|
+
## SOP
|
|
62
|
+
|
|
63
|
+
### 1. Entry Point Location
|
|
64
|
+
|
|
65
|
+
**Macro entries**:
|
|
66
|
+
1. Project root README.md
|
|
67
|
+
2. docs/ directory
|
|
68
|
+
3. package.json / pyproject.toml
|
|
69
|
+
4. CHANGELOG.md
|
|
70
|
+
|
|
71
|
+
**Micro entries**:
|
|
72
|
+
1. Grep for keywords
|
|
73
|
+
2. src/index.* or main.*
|
|
74
|
+
3. Type definitions (src/types/)
|
|
75
|
+
4. Test files
|
|
76
|
+
|
|
77
|
+
### 2. Dependency Analysis
|
|
78
|
+
|
|
79
|
+
**Module dependencies**:
|
|
80
|
+
- Analyze import/export relationships
|
|
81
|
+
- Identify core vs auxiliary modules
|
|
82
|
+
- Build mental dependency graph
|
|
83
|
+
|
|
84
|
+
**External dependencies**:
|
|
85
|
+
- Extract production vs dev dependencies
|
|
86
|
+
- Identify core libraries and their purpose
|
|
87
|
+
- Note version constraints
|
|
88
|
+
|
|
89
|
+
**Data dependencies**:
|
|
90
|
+
- Identify shared data structures
|
|
91
|
+
- Trace data flow paths
|
|
92
|
+
- Understand state management
|
|
93
|
+
|
|
94
|
+
**⚠️ Checkpoint**: After completing dependency analysis, `log_append` key module relationships before proceeding.
|
|
95
|
+
|
|
96
|
+
### 3. Data Flow Tracing
|
|
97
|
+
|
|
98
|
+
**For functional tasks**:
|
|
99
|
+
- Start from user input
|
|
100
|
+
- Track through modules
|
|
101
|
+
- Identify transformations
|
|
102
|
+
- Locate final output
|
|
103
|
+
|
|
104
|
+
**For system tasks**:
|
|
105
|
+
- Identify core data structures
|
|
106
|
+
- Understand persistence
|
|
107
|
+
- Analyze sync mechanisms
|
|
108
|
+
- Trace config propagation
|
|
109
|
+
|
|
110
|
+
**Visualization rules**:
|
|
111
|
+
- Code investigation: **MUST** use mermaid sequenceDiagram
|
|
112
|
+
- Architecture overview: flowchart or simple `A → B → C`
|
|
113
|
+
|
|
114
|
+
**⚠️ Checkpoint**: After tracing data flow, `log_append` the flow diagram before proceeding.
|
|
115
|
+
|
|
116
|
+
### 4. Output Knowledge Snapshot
|
|
117
|
+
|
|
118
|
+
Structure findings using output template.
|
|
119
|
+
|
|
120
|
+
### 5. Record to Workspace (MANDATORY)
|
|
121
|
+
|
|
122
|
+
After exploration, MUST record to workspace node:
|
|
123
|
+
|
|
124
|
+
**Recording locations**:
|
|
125
|
+
| Content | Location | Tool |
|
|
126
|
+
|---------|----------|------|
|
|
127
|
+
| Key conclusions (brief) | conclusion | node_update |
|
|
128
|
+
| Scope, key files, dependencies | notes | node_update |
|
|
129
|
+
| Full knowledge snapshot (>200 lines) | MEMO | memo_create + node_reference |
|
|
130
|
+
|
|
131
|
+
**NEVER hardcode MEMO IDs** in text like "见 MEMO#xxx". Use `node_reference` to link.
|
|
132
|
+
|
|
133
|
+
**Reference rules** (investigation tasks MUST include):
|
|
134
|
+
- Key files: `file:line` format
|
|
135
|
+
- Entry points: exact location
|
|
136
|
+
- Dependencies: module names with paths
|
|
137
|
+
- Core principle: references enable traceability, not bureaucracy
|
|
138
|
+
|
|
139
|
+
**Conclusion template** (brief):
|
|
140
|
+
```
|
|
141
|
+
[探索范围] + [关键发现] + [待确认项]
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**Notes template** (detailed):
|
|
145
|
+
```
|
|
146
|
+
**Strategy**: Macro/Micro
|
|
147
|
+
**Scanned**: [directories/files]
|
|
148
|
+
**Key Files**:
|
|
149
|
+
- Entry: file:line
|
|
150
|
+
- Types: file
|
|
151
|
+
**Dependencies**: [list]
|
|
152
|
+
**Data Flow**: [brief]
|
|
153
|
+
**Uncertainties**: [items]
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
**Output**: node_update called with conclusion + notes
|
|
157
|
+
|
|
158
|
+
### 6. Present to User (MANDATORY)
|
|
159
|
+
|
|
160
|
+
After recording, MUST present findings to user:
|
|
161
|
+
|
|
162
|
+
1. **Output summary**: Show key findings using Output Template
|
|
163
|
+
2. **Wait for confirmation**: Ask user if findings are correct/complete
|
|
164
|
+
3. **NEVER proceed directly**: Do NOT start execution without user acknowledgment
|
|
165
|
+
|
|
166
|
+
**Output**: Summary presented, user confirmation received
|
|
167
|
+
|
|
168
|
+
## Information Source Priority
|
|
169
|
+
|
|
170
|
+
1. **Codebase**: Most reliable, implementation is truth
|
|
171
|
+
2. **Docs**: Official documentation, design docs
|
|
172
|
+
3. **User**: Confirm requirements and expectations
|
|
173
|
+
4. **Public Knowledge**: Tech docs, best practices
|
|
174
|
+
|
|
175
|
+
**Rules**:
|
|
176
|
+
- Code conflicts with docs → Trust code
|
|
177
|
+
- Docs missing → Check code first, then ask user
|
|
178
|
+
- Uncertain → Mark as "to be confirmed"
|
|
179
|
+
|
|
180
|
+
## Output Template
|
|
181
|
+
|
|
182
|
+
```markdown
|
|
183
|
+
### Discovery Summary
|
|
184
|
+
**Scope**: [What was explored]
|
|
185
|
+
**Strategy**: Macro / Micro
|
|
186
|
+
|
|
187
|
+
### Key Files
|
|
188
|
+
| Role | File | Description |
|
|
189
|
+
|------|------|-------------|
|
|
190
|
+
| Entry | file:line | [description] |
|
|
191
|
+
| Types | file | [description] |
|
|
192
|
+
| Config | file | [description] |
|
|
193
|
+
|
|
194
|
+
### Dependencies
|
|
195
|
+
- **Internal**: [module relationships]
|
|
196
|
+
- **External**: [key libraries]
|
|
197
|
+
|
|
198
|
+
### Data Flow
|
|
199
|
+
[Visualize with mermaid sequenceDiagram or flowchart]
|
|
200
|
+
|
|
201
|
+
```mermaid
|
|
202
|
+
sequenceDiagram
|
|
203
|
+
participant A
|
|
204
|
+
participant B
|
|
205
|
+
A->>B: [action]
|
|
206
|
+
B-->>A: [response]
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Findings
|
|
210
|
+
- [Key finding 1]
|
|
211
|
+
- [Key finding 2]
|
|
212
|
+
|
|
213
|
+
### Uncertainties
|
|
214
|
+
- [ ] [Item needing confirmation]
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## Checklist
|
|
218
|
+
|
|
219
|
+
### Macro
|
|
220
|
+
- [ ] Project overview understood
|
|
221
|
+
- [ ] Tech stack identified
|
|
222
|
+
- [ ] Module structure mapped
|
|
223
|
+
- [ ] Data flow documented
|
|
224
|
+
- [ ] Config/deployment understood
|
|
225
|
+
|
|
226
|
+
### Micro
|
|
227
|
+
- [ ] Entry point located
|
|
228
|
+
- [ ] Key functions identified
|
|
229
|
+
- [ ] Type definitions understood
|
|
230
|
+
- [ ] Dependencies traced
|
|
231
|
+
- [ ] Data flow traced
|
|
232
|
+
- [ ] Error handling identified
|
|
233
|
+
|
|
234
|
+
### Recording (MANDATORY)
|
|
235
|
+
- [ ] **Conclusion written**: Brief summary in node conclusion
|
|
236
|
+
- [ ] **Notes written**: Scope, key files, dependencies in node notes
|
|
237
|
+
- [ ] **MEMO linked**: Long content in MEMO, linked via node_reference (not hardcoded ID)
|
|
238
|
+
- [ ] **Wipe test**: If context wiped now, can recall details from recorded content?
|
|
239
|
+
|
|
240
|
+
### Long Content Protection
|
|
241
|
+
- [ ] **Progressive recording**: Used `log_append` after each major discovery
|
|
242
|
+
- [ ] **References complete**: All key files have `file:line` references
|
|
243
|
+
- [ ] **Checkpoints hit**: Logged after dependency analysis and data flow tracing
|
|
244
|
+
- [ ] **Output Template complete**: Every section filled, no placeholders left
|
|
245
|
+
|
|
246
|
+
## Red Flags
|
|
247
|
+
|
|
248
|
+
1. **Skip exploration** - Start implementing without reading existing code
|
|
249
|
+
2. **Assume existence** - Assume feature exists without verification
|
|
250
|
+
3. **Ignore dependencies** - Don't check module relationships
|
|
251
|
+
4. **Wrong strategy** - Use docs when should use code, or vice versa
|
|
252
|
+
5. **Silent execution** - Complete exploration, then immediately start implementing without showing user
|
|
253
|
+
6. **Batch recording** - Explore for 30+ minutes without any `log_append`
|
|
254
|
+
7. **Missing references** - Conclusions without `file:line` references
|
|
255
|
+
8. **Skip checkpoints** - Complete long exploration without intermediate logs
|
|
256
|
+
|
|
257
|
+
## Mandatory Rules
|
|
258
|
+
|
|
259
|
+
1. **MUST explore before implementing** - NEVER code without understanding existing patterns
|
|
260
|
+
2. **MUST verify existence** - NEVER assume feature/module exists, check code
|
|
261
|
+
3. **MUST trust code over docs** - When docs conflict with code, code is truth
|
|
262
|
+
4. **MUST record findings** - Exploration without documentation is wasted effort
|
|
263
|
+
5. **MUST scope exploration** - Explore what's needed, not the entire project
|
|
264
|
+
6. **MUST present before proceed** - After exploration, NEVER start execution directly. Present findings, wait for user confirmation
|
|
265
|
+
|
|
266
|
+
## Anti-Patterns
|
|
267
|
+
|
|
268
|
+
| Pattern | Wrong | Right |
|
|
269
|
+
|---------|-------|-------|
|
|
270
|
+
| **Blind start** | Code without reading existing code | Grep/Glob to locate relevant code first |
|
|
271
|
+
| **Over-explore** | Read entire project | Scope to task needs |
|
|
272
|
+
| **Trust docs over code** | Docs say X exists, believe it | Code is truth, docs may be stale |
|
|
273
|
+
| **No record** | Explore and forget | Output structured knowledge snapshot |
|
|
274
|
+
|
|
275
|
+
## Common Rationalizations
|
|
276
|
+
|
|
277
|
+
| Excuse | Why Wrong | Correct Action |
|
|
278
|
+
|--------|-----------|----------------|
|
|
279
|
+
| "I'll figure it out as I code" | Leads to wrong assumptions and rework | Explore first, code informed |
|
|
280
|
+
| "The docs explain everything" | Docs are often outdated or incomplete | Verify against actual code |
|
|
281
|
+
| "I've worked on similar projects" | This project may have different patterns | Check this specific codebase |
|
|
282
|
+
| "Exploration takes too long" | Coding without context takes longer | 20 min exploration saves hours |
|
|
283
|
+
| "I'll just ask if I get stuck" | User may not know implementation details | Code is the authoritative source |
|