autosnippet 3.3.0 → 3.3.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/dashboard/dist/assets/icons-BJ2mUBi8.js +1 -0
- package/dashboard/dist/assets/index-B659K9t5.js +128 -0
- package/dashboard/dist/assets/index-NCm40PMD.css +1 -0
- package/dashboard/dist/index.html +3 -3
- package/dist/bin/cli.d.ts +1 -0
- package/dist/bin/cli.js +284 -142
- package/dist/lib/agent/context/ExplorationTracker.d.ts +2 -0
- package/dist/lib/agent/context/ExplorationTracker.js +21 -3
- package/dist/lib/agent/core/ToolExecutionPipeline.d.ts +3 -1
- package/dist/lib/agent/core/ToolExecutionPipeline.js +8 -1
- package/dist/lib/agent/forge/DynamicComposer.d.ts +58 -0
- package/dist/lib/agent/forge/DynamicComposer.js +99 -0
- package/dist/lib/agent/forge/SandboxRunner.d.ts +60 -0
- package/dist/lib/agent/forge/SandboxRunner.js +251 -0
- package/dist/lib/agent/forge/TemporaryToolRegistry.d.ts +76 -0
- package/dist/lib/agent/forge/TemporaryToolRegistry.js +154 -0
- package/dist/lib/agent/forge/ToolForge.d.ts +92 -0
- package/dist/lib/agent/forge/ToolForge.js +239 -0
- package/dist/lib/agent/forge/ToolRequirementAnalyzer.d.ts +44 -0
- package/dist/lib/agent/forge/ToolRequirementAnalyzer.js +119 -0
- package/dist/lib/agent/tools/ToolRegistry.d.ts +2 -0
- package/dist/lib/agent/tools/ToolRegistry.js +4 -0
- package/dist/lib/agent/tools/composite.js +0 -1
- package/dist/lib/agent/tools/index.d.ts +2 -50
- package/dist/lib/agent/tools/index.js +2 -3
- package/dist/lib/agent/tools/lifecycle.d.ts +1 -58
- package/dist/lib/agent/tools/lifecycle.js +2 -75
- package/dist/lib/cli/KnowledgeSyncService.d.ts +26 -0
- package/dist/lib/cli/KnowledgeSyncService.js +33 -1
- package/dist/lib/cli/deploy/FileManifest.d.ts +0 -21
- package/dist/lib/cli/deploy/FileManifest.js +0 -11
- package/dist/lib/domain/knowledge/KnowledgeEntry.d.ts +10 -0
- package/dist/lib/domain/knowledge/KnowledgeEntry.js +2 -0
- package/dist/lib/domain/knowledge/Lifecycle.d.ts +19 -2
- package/dist/lib/domain/knowledge/Lifecycle.js +32 -6
- package/dist/lib/domain/knowledge/UnifiedValidator.d.ts +1 -5
- package/dist/lib/domain/knowledge/UnifiedValidator.js +7 -44
- package/dist/lib/domain/knowledge/values/Stats.d.ts +29 -0
- package/dist/lib/domain/knowledge/values/Stats.js +41 -0
- package/dist/lib/external/mcp/McpServer.d.ts +19 -38
- package/dist/lib/external/mcp/McpServer.js +145 -117
- package/dist/lib/external/mcp/autoApproveInjector.js +0 -2
- package/dist/lib/external/mcp/handlers/bootstrap/MissionBriefingBuilder.d.ts +26 -1
- package/dist/lib/external/mcp/handlers/bootstrap/MissionBriefingBuilder.js +41 -0
- package/dist/lib/external/mcp/handlers/bootstrap/pipeline/orchestrator.js +49 -0
- package/dist/lib/external/mcp/handlers/bootstrap/shared/bootstrap-phases.d.ts +3 -0
- package/dist/lib/external/mcp/handlers/bootstrap/shared/bootstrap-phases.js +27 -0
- package/dist/lib/external/mcp/handlers/bootstrap/skills.js +1 -1
- package/dist/lib/external/mcp/handlers/bootstrap-external.js +1 -0
- package/dist/lib/external/mcp/handlers/bootstrap-internal.js +2 -0
- package/dist/lib/external/mcp/handlers/browse.d.ts +1 -0
- package/dist/lib/external/mcp/handlers/browse.js +2 -1
- package/dist/lib/external/mcp/handlers/consolidated.d.ts +117 -6
- package/dist/lib/external/mcp/handlers/consolidated.js +251 -71
- package/dist/lib/external/mcp/handlers/guard.d.ts +150 -0
- package/dist/lib/external/mcp/handlers/guard.js +239 -5
- package/dist/lib/external/mcp/handlers/knowledge.d.ts +0 -29
- package/dist/lib/external/mcp/handlers/knowledge.js +1 -76
- package/dist/lib/external/mcp/handlers/panorama.d.ts +36 -0
- package/dist/lib/external/mcp/handlers/panorama.js +156 -0
- package/dist/lib/external/mcp/handlers/system.d.ts +2 -54
- package/dist/lib/external/mcp/handlers/system.js +3 -113
- package/dist/lib/external/mcp/handlers/task.d.ts +13 -24
- package/dist/lib/external/mcp/handlers/task.js +218 -557
- package/dist/lib/external/mcp/handlers/types.d.ts +91 -8
- package/dist/lib/external/mcp/handlers/types.js +18 -1
- package/dist/lib/external/mcp/handlers/wiki-external.d.ts +18 -1
- package/dist/lib/external/mcp/handlers/wiki-external.js +16 -1
- package/dist/lib/external/mcp/tools.d.ts +18 -24
- package/dist/lib/external/mcp/tools.js +132 -159
- package/dist/lib/http/HttpServer.js +52 -0
- package/dist/lib/http/middleware/validate.js +7 -3
- package/dist/lib/http/routes/audit.d.ts +8 -0
- package/dist/lib/http/routes/audit.js +51 -0
- package/dist/lib/http/routes/guardReport.d.ts +10 -0
- package/dist/lib/http/routes/guardReport.js +143 -0
- package/dist/lib/http/routes/knowledge.js +32 -1
- package/dist/lib/http/routes/panorama.d.ts +11 -0
- package/dist/lib/http/routes/panorama.js +322 -0
- package/dist/lib/http/routes/signals.d.ts +10 -0
- package/dist/lib/http/routes/signals.js +104 -0
- package/dist/lib/http/routes/task.d.ts +2 -3
- package/dist/lib/http/routes/task.js +17 -347
- package/dist/lib/http/routes/violations.js +1 -1
- package/dist/lib/infrastructure/audit/AuditLogger.d.ts +6 -1
- package/dist/lib/infrastructure/audit/AuditLogger.js +14 -1
- package/dist/lib/infrastructure/database/drizzle/schema.d.ts +202 -504
- package/dist/lib/infrastructure/database/drizzle/schema.js +38 -69
- package/dist/lib/infrastructure/database/migrations/004_evolution_proposals.d.ts +8 -0
- package/dist/lib/infrastructure/database/migrations/004_evolution_proposals.js +43 -0
- package/dist/lib/infrastructure/database/migrations/005_recipe_source_refs.d.ts +9 -0
- package/dist/lib/infrastructure/database/migrations/005_recipe_source_refs.js +24 -0
- package/dist/lib/infrastructure/logging/Logger.d.ts +2 -0
- package/dist/lib/infrastructure/logging/Logger.js +34 -7
- package/dist/lib/infrastructure/monitoring/ErrorTracker.js +3 -1
- package/dist/lib/infrastructure/monitoring/PerformanceMonitor.d.ts +2 -2
- package/dist/lib/infrastructure/monitoring/PerformanceMonitor.js +12 -10
- package/dist/lib/infrastructure/notification/LarkNotifier.d.ts +24 -0
- package/dist/lib/infrastructure/notification/LarkNotifier.js +97 -0
- package/dist/lib/infrastructure/report/ReportStore.d.ts +45 -0
- package/dist/lib/infrastructure/report/ReportStore.js +133 -0
- package/dist/lib/infrastructure/signal/SignalAggregator.d.ts +18 -0
- package/dist/lib/infrastructure/signal/SignalAggregator.js +84 -0
- package/dist/lib/infrastructure/signal/SignalBridge.d.ts +13 -0
- package/dist/lib/infrastructure/signal/SignalBridge.js +20 -0
- package/dist/lib/infrastructure/signal/SignalBus.d.ts +63 -0
- package/dist/lib/infrastructure/signal/SignalBus.js +106 -0
- package/dist/lib/infrastructure/signal/SignalTraceWriter.d.ts +36 -0
- package/dist/lib/infrastructure/signal/SignalTraceWriter.js +130 -0
- package/dist/lib/infrastructure/vector/HnswVectorAdapter.js +18 -2
- package/dist/lib/injection/ServiceContainer.js +8 -0
- package/dist/lib/injection/ServiceMap.d.ts +16 -10
- package/dist/lib/injection/modules/AgentModule.d.ts +1 -1
- package/dist/lib/injection/modules/AgentModule.js +7 -1
- package/dist/lib/injection/modules/AppModule.d.ts +1 -1
- package/dist/lib/injection/modules/AppModule.js +4 -13
- package/dist/lib/injection/modules/GuardModule.js +27 -2
- package/dist/lib/injection/modules/InfraModule.d.ts +0 -1
- package/dist/lib/injection/modules/InfraModule.js +9 -7
- package/dist/lib/injection/modules/KnowledgeModule.d.ts +5 -0
- package/dist/lib/injection/modules/KnowledgeModule.js +131 -0
- package/dist/lib/injection/modules/PanoramaModule.d.ts +18 -0
- package/dist/lib/injection/modules/PanoramaModule.js +76 -0
- package/dist/lib/injection/modules/SignalModule.d.ts +10 -0
- package/dist/lib/injection/modules/SignalModule.js +84 -0
- package/dist/lib/repository/knowledge/KnowledgeRepository.impl.d.ts +1 -0
- package/dist/lib/repository/knowledge/KnowledgeRepository.impl.js +6 -0
- package/dist/lib/service/bootstrap/BootstrapTaskManager.d.ts +3 -1
- package/dist/lib/service/bootstrap/BootstrapTaskManager.js +20 -1
- package/dist/lib/service/bootstrap/UiStartupTasks.d.ts +45 -0
- package/dist/lib/service/bootstrap/UiStartupTasks.js +101 -0
- package/dist/lib/service/delivery/AgentInstructionsGenerator.js +4 -5
- package/dist/lib/service/delivery/CursorDeliveryPipeline.d.ts +3 -1
- package/dist/lib/service/delivery/CursorDeliveryPipeline.js +13 -10
- package/dist/lib/service/delivery/RulesGenerator.js +3 -2
- package/dist/lib/service/evolution/ConsolidationAdvisor.d.ts +114 -0
- package/dist/lib/service/evolution/ConsolidationAdvisor.js +542 -0
- package/dist/lib/service/evolution/ContradictionDetector.d.ts +54 -0
- package/dist/lib/service/evolution/ContradictionDetector.js +253 -0
- package/dist/lib/service/evolution/DecayDetector.d.ts +71 -0
- package/dist/lib/service/evolution/DecayDetector.js +244 -0
- package/dist/lib/service/evolution/EnhancementSuggester.d.ts +38 -0
- package/dist/lib/service/evolution/EnhancementSuggester.js +220 -0
- package/dist/lib/service/evolution/KnowledgeMetabolism.d.ts +82 -0
- package/dist/lib/service/evolution/KnowledgeMetabolism.js +167 -0
- package/dist/lib/service/evolution/RedundancyAnalyzer.d.ts +53 -0
- package/dist/lib/service/evolution/RedundancyAnalyzer.js +210 -0
- package/dist/lib/service/evolution/StagingManager.d.ts +57 -0
- package/dist/lib/service/evolution/StagingManager.js +201 -0
- package/dist/lib/service/guard/ComplianceReporter.d.ts +42 -2
- package/dist/lib/service/guard/ComplianceReporter.js +43 -5
- package/dist/lib/service/guard/CoverageAnalyzer.d.ts +54 -0
- package/dist/lib/service/guard/CoverageAnalyzer.js +149 -0
- package/dist/lib/service/guard/GuardCheckEngine.d.ts +42 -0
- package/dist/lib/service/guard/GuardCheckEngine.js +465 -14
- package/dist/lib/service/guard/GuardFeedbackLoop.d.ts +3 -0
- package/dist/lib/service/guard/GuardFeedbackLoop.js +9 -0
- package/dist/lib/service/guard/ReverseGuard.d.ts +73 -0
- package/dist/lib/service/guard/ReverseGuard.js +256 -0
- package/dist/lib/service/guard/RuleLearner.d.ts +12 -0
- package/dist/lib/service/guard/RuleLearner.js +38 -0
- package/dist/lib/service/guard/UncertaintyCollector.d.ts +83 -0
- package/dist/lib/service/guard/UncertaintyCollector.js +149 -0
- package/dist/lib/service/guard/ViolationsStore.d.ts +1 -0
- package/dist/lib/service/guard/ViolationsStore.js +33 -3
- package/dist/lib/service/knowledge/ConfidenceRouter.d.ts +13 -0
- package/dist/lib/service/knowledge/ConfidenceRouter.js +14 -0
- package/dist/lib/service/knowledge/KnowledgeService.js +22 -4
- package/dist/lib/service/knowledge/SourceRefReconciler.d.ts +68 -0
- package/dist/lib/service/knowledge/SourceRefReconciler.js +309 -0
- package/dist/lib/service/panorama/CouplingAnalyzer.d.ts +27 -0
- package/dist/lib/service/panorama/CouplingAnalyzer.js +192 -0
- package/dist/lib/service/panorama/DimensionAnalyzer.d.ts +28 -0
- package/dist/lib/service/panorama/DimensionAnalyzer.js +320 -0
- package/dist/lib/service/panorama/LayerInferrer.d.ts +19 -0
- package/dist/lib/service/panorama/LayerInferrer.js +182 -0
- package/dist/lib/service/panorama/ModuleDiscoverer.d.ts +24 -0
- package/dist/lib/service/panorama/ModuleDiscoverer.js +185 -0
- package/dist/lib/service/panorama/PanoramaAggregator.d.ts +29 -0
- package/dist/lib/service/panorama/PanoramaAggregator.js +228 -0
- package/dist/lib/service/panorama/PanoramaScanner.d.ts +52 -0
- package/dist/lib/service/panorama/PanoramaScanner.js +188 -0
- package/dist/lib/service/panorama/PanoramaService.d.ts +125 -0
- package/dist/lib/service/panorama/PanoramaService.js +363 -0
- package/dist/lib/service/panorama/PanoramaTypes.d.ts +134 -0
- package/dist/lib/service/panorama/PanoramaTypes.js +6 -0
- package/dist/lib/service/panorama/RoleRefiner.d.ts +48 -0
- package/dist/lib/service/panorama/RoleRefiner.js +535 -0
- package/dist/lib/service/search/BM25Scorer.d.ts +2 -2
- package/dist/lib/service/search/CoarseRanker.d.ts +7 -6
- package/dist/lib/service/search/CoarseRanker.js +11 -10
- package/dist/lib/service/search/FieldWeightedScorer.d.ts +81 -0
- package/dist/lib/service/search/FieldWeightedScorer.js +318 -0
- package/dist/lib/service/search/MultiSignalRanker.d.ts +3 -2
- package/dist/lib/service/search/MultiSignalRanker.js +17 -1
- package/dist/lib/service/search/SearchEngine.d.ts +9 -7
- package/dist/lib/service/search/SearchEngine.js +67 -10
- package/dist/lib/service/search/SearchTypes.d.ts +25 -3
- package/dist/lib/service/search/SearchTypes.js +6 -1
- package/dist/lib/service/signal/HitRecorder.d.ts +68 -0
- package/dist/lib/service/signal/HitRecorder.js +173 -0
- package/dist/lib/service/skills/SignalCollector.d.ts +3 -1
- package/dist/lib/service/skills/SignalCollector.js +31 -1
- package/dist/lib/service/task/IntentExtractor.d.ts +66 -0
- package/dist/lib/service/task/IntentExtractor.js +256 -0
- package/dist/lib/service/task/PrimeSearchPipeline.d.ts +54 -0
- package/dist/lib/service/task/PrimeSearchPipeline.js +113 -0
- package/dist/lib/service/vector/VectorService.d.ts +3 -0
- package/dist/lib/service/vector/VectorService.js +38 -4
- package/dist/lib/shared/schemas/mcp-tools.d.ts +41 -96
- package/dist/lib/shared/schemas/mcp-tools.js +59 -119
- package/dist/scripts/analyze-signals.d.ts +20 -0
- package/dist/scripts/analyze-signals.js +155 -0
- package/dist/scripts/diagnose-mcp.js +1 -1
- package/package.json +1 -1
- package/skills/autosnippet-create/SKILL.md +98 -89
- package/skills/autosnippet-devdocs/SKILL.md +55 -57
- package/templates/claude-code/hooks/autosnippet-session.sh +10 -15
- package/templates/cursor-hooks/hooks/session-start.sh +1 -1
- package/templates/guard-ci.yml +2 -2
- package/templates/instructions/agent-static.md +2 -1
- package/templates/instructions/conventions.md +5 -6
- package/templates/recipes-setup/README.md +1 -2
- package/templates/recipes-setup/_template.md +39 -39
- package/dashboard/dist/assets/icons-BofcEZ3f.js +0 -1
- package/dashboard/dist/assets/index-D0whuycy.css +0 -1
- package/dashboard/dist/assets/index-SiN1GChm.js +0 -128
- package/dist/lib/domain/task/Task.d.ts +0 -140
- package/dist/lib/domain/task/Task.js +0 -254
- package/dist/lib/domain/task/TaskDependency.d.ts +0 -23
- package/dist/lib/domain/task/TaskDependency.js +0 -34
- package/dist/lib/domain/task/TaskIdGenerator.d.ts +0 -40
- package/dist/lib/domain/task/TaskIdGenerator.js +0 -75
- package/dist/lib/domain/task/index.d.ts +0 -4
- package/dist/lib/domain/task/index.js +0 -4
- package/dist/lib/infrastructure/database/migrations/002_add_tasks.d.ts +0 -11
- package/dist/lib/infrastructure/database/migrations/002_add_tasks.js +0 -86
- package/dist/lib/repository/task/TaskRepository.impl.d.ts +0 -171
- package/dist/lib/repository/task/TaskRepository.impl.js +0 -347
- package/dist/lib/service/task/TaskGraphService.d.ts +0 -222
- package/dist/lib/service/task/TaskGraphService.js +0 -597
- package/dist/lib/service/task/TaskKnowledgeBridge.d.ts +0 -95
- package/dist/lib/service/task/TaskKnowledgeBridge.js +0 -298
- package/dist/lib/service/task/TaskReadyEngine.d.ts +0 -84
- package/dist/lib/service/task/TaskReadyEngine.js +0 -115
|
@@ -1,97 +1,94 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: autosnippet-create
|
|
3
|
-
description: Submit knowledge to AutoSnippet. Covers single/batch MCP submission, V3 field requirements, quality validation, and lifecycle. Use when user says "
|
|
3
|
+
description: Submit knowledge to AutoSnippet. Covers single/batch MCP submission, V3 field requirements, quality validation, and lifecycle. Use when user says "submit knowledge / add to KB / create recipe" or agent needs to persist code patterns, rules, or facts.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# AutoSnippet Create —
|
|
6
|
+
# AutoSnippet Create — Knowledge Submission
|
|
7
7
|
|
|
8
|
-
>
|
|
8
|
+
> Prerequisite: MCP tools return a unified JSON Envelope `{ success, errorCode?, message?, data?, meta }`. Call `autosnippet_health` before operations to confirm service availability.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
This Skill guides the Agent to submit code patterns, rules, and facts to the AutoSnippet knowledge base. Submitted entries enter **Candidates** (pending status); users review and publish them via the Dashboard.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Related Skill: **autosnippet-recipes** (search existing knowledge).
|
|
13
13
|
|
|
14
14
|
---
|
|
15
15
|
|
|
16
|
-
##
|
|
16
|
+
## Submission Paths
|
|
17
17
|
|
|
18
|
-
|
|
|
18
|
+
| Path | Tool | Use Case |
|
|
19
19
|
|------|------|----------|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
| **Dashboard** |
|
|
20
|
+
| **Single** | `autosnippet_submit_knowledge` | Agent carefully constructs one complete entry |
|
|
21
|
+
| **Batch** | `autosnippet_submit_knowledge` (items array) | Cold-start dimension analysis, batch scans |
|
|
22
|
+
| **Dashboard** | Browser `http://localhost:3000` | User manual paste/file scan |
|
|
23
23
|
|
|
24
|
-
**Agent
|
|
24
|
+
**Agent prefers MCP submission** — no browser needed.
|
|
25
25
|
|
|
26
26
|
---
|
|
27
27
|
|
|
28
|
-
##
|
|
28
|
+
## Single Submission — autosnippet_submit_knowledge
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
Submit one complete V3 knowledge entry at a time. Even if some fields fail validation, the entry is still stored; the response includes `recipeReadyHints` indicating missing fields.
|
|
31
31
|
|
|
32
|
-
### V3
|
|
32
|
+
### V3 Required Fields (16)
|
|
33
33
|
|
|
34
|
-
|
|
|
35
|
-
|
|
36
|
-
| `title` | string |
|
|
37
|
-
| `description` | string |
|
|
38
|
-
| `trigger` | string |
|
|
39
|
-
| `language` | string |
|
|
40
|
-
| `kind` | enum | `rule
|
|
34
|
+
| Field | Type | Description |
|
|
35
|
+
|-------|------|-------------|
|
|
36
|
+
| `title` | string | Knowledge title, concise and clear |
|
|
37
|
+
| `description` | string | One-line purpose description |
|
|
38
|
+
| `trigger` | string | Trigger keyword, e.g. `@NetworkMonitor` |
|
|
39
|
+
| `language` | string | Programming language, e.g. `typescript`, `swift` |
|
|
40
|
+
| `kind` | enum | `rule` (constraint) / `pattern` (reusable) / `fact` (project fact) |
|
|
41
41
|
| `category` | string | `View`/`Service`/`Tool`/`Model`/`Network`/`Storage`/`UI`/`Utility` |
|
|
42
|
-
| `knowledgeType` | string |
|
|
43
|
-
| `doClause` | string | ✅
|
|
44
|
-
| `dontClause` | string | ❌
|
|
45
|
-
| `whenClause` | string |
|
|
46
|
-
| `coreCode` | string |
|
|
47
|
-
| `headers` | string[] |
|
|
48
|
-
| `usageGuide` | string |
|
|
49
|
-
| `content` | object | `{ markdown: string, rationale: string }`
|
|
42
|
+
| `knowledgeType` | string | Knowledge type identifier |
|
|
43
|
+
| `doClause` | string | ✅ What to do (Channel A+B hard dependency) |
|
|
44
|
+
| `dontClause` | string | ❌ What not to do |
|
|
45
|
+
| `whenClause` | string | When to apply (Channel B hard dependency) |
|
|
46
|
+
| `coreCode` | string | Core code snippet |
|
|
47
|
+
| `headers` | string[] | Complete import statement list |
|
|
48
|
+
| `usageGuide` | string | Usage guide (Markdown, see format below) |
|
|
49
|
+
| `content` | object | `{ markdown: string, rationale: string }` — at minimum provide markdown |
|
|
50
50
|
| `reasoning` | object | `{ whyStandard: string, sources: string[], confidence: number }` |
|
|
51
51
|
|
|
52
|
-
###
|
|
52
|
+
### Optional Fields
|
|
53
53
|
|
|
54
|
-
`topicHint
|
|
54
|
+
`topicHint`, `complexity` (beginner/intermediate/advanced), `scope` (universal/project-specific/target-specific), `tags` (string[]), `constraints`, `relations`, `skipDuplicateCheck` (default false)
|
|
55
55
|
|
|
56
|
-
### usageGuide
|
|
56
|
+
### usageGuide Format Requirements
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
**Must** use Markdown sections. Never write as a single long line.
|
|
59
59
|
|
|
60
60
|
```markdown
|
|
61
|
-
###
|
|
62
|
-
-
|
|
63
|
-
-
|
|
61
|
+
### When to Use
|
|
62
|
+
- Scenario A
|
|
63
|
+
- Scenario B
|
|
64
64
|
|
|
65
|
-
###
|
|
66
|
-
-
|
|
65
|
+
### When Not to Use
|
|
66
|
+
- Exclusion scenario
|
|
67
67
|
|
|
68
|
-
###
|
|
69
|
-
1.
|
|
70
|
-
2.
|
|
68
|
+
### Steps
|
|
69
|
+
1. First step
|
|
70
|
+
2. Second step
|
|
71
71
|
|
|
72
|
-
###
|
|
73
|
-
-
|
|
74
|
-
-
|
|
72
|
+
### Key Points
|
|
73
|
+
- Note A
|
|
74
|
+
- Note B
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
Optional sections: Dependencies & Prerequisites, Error Handling, Performance & Resources, Security & Compliance, Common Misuse, Alternatives, Related Knowledge.
|
|
78
78
|
|
|
79
79
|
---
|
|
80
80
|
|
|
81
|
-
##
|
|
81
|
+
## Batch Submission — autosnippet_submit_knowledge (items array)
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
Submit multiple entries at once. Each is validated independently; failures are rejected without blocking others.
|
|
84
84
|
|
|
85
|
-
###
|
|
85
|
+
### Parameters
|
|
86
86
|
|
|
87
|
-
|
|
|
88
|
-
|
|
89
|
-
| `
|
|
90
|
-
| `items` | ✅ | object[] | 知识条目数组,每条结构同单条提交的字段 |
|
|
91
|
-
| `source` | | string | 来源标记,默认 `cursor-scan` |
|
|
92
|
-
| `deduplicate` | | boolean | 基于 title 去重,默认 `true` |
|
|
87
|
+
| Field | Required | Type | Description |
|
|
88
|
+
|-------|----------|------|-------------|
|
|
89
|
+
| `items` | ✅ | object[] | Array of knowledge entries, each following the same field structure as single submission |
|
|
93
90
|
|
|
94
|
-
###
|
|
91
|
+
### Response
|
|
95
92
|
|
|
96
93
|
```json
|
|
97
94
|
{
|
|
@@ -104,75 +101,87 @@ description: Submit knowledge to AutoSnippet. Covers single/batch MCP submission
|
|
|
104
101
|
}
|
|
105
102
|
```
|
|
106
103
|
|
|
107
|
-
|
|
104
|
+
**Batch validation is stricter**: single submission stores entries even with validation warnings (with hints), **batch submission rejects entries that fail validation**.
|
|
108
105
|
|
|
109
106
|
---
|
|
110
107
|
|
|
111
|
-
##
|
|
108
|
+
## Submission Workflow
|
|
112
109
|
|
|
113
|
-
###
|
|
110
|
+
### Standard Flow (Agent via MCP)
|
|
114
111
|
|
|
115
112
|
```
|
|
116
|
-
1.
|
|
117
|
-
2. autosnippet_submit_knowledge
|
|
118
|
-
3.
|
|
119
|
-
-
|
|
120
|
-
-
|
|
121
|
-
4. [
|
|
113
|
+
1. Analyze code → construct V3 fields
|
|
114
|
+
2. autosnippet_submit_knowledge → stored as pending
|
|
115
|
+
3. Check response:
|
|
116
|
+
- Success → inform user "Submitted. Review in Dashboard Candidates."
|
|
117
|
+
- Has rejectedItems → fill in missing fields per rejectedSummary.commonMissingFields, retry
|
|
118
|
+
4. [Optional] autosnippet_enrich_candidates → diagnose candidate field completeness
|
|
122
119
|
```
|
|
123
120
|
|
|
124
|
-
###
|
|
121
|
+
### One Entry Per Scenario
|
|
125
122
|
|
|
126
|
-
|
|
123
|
+
Splitting principle: different use cases, different API endpoints, different configurations → separate entries each. Never merge multiple patterns into one.
|
|
124
|
+
|
|
125
|
+
### Batch Anti-Redundancy Rules (⚠️ MANDATORY)
|
|
126
|
+
|
|
127
|
+
**Items in the array must NOT be cross-redundant**:
|
|
128
|
+
- No highly overlapping doClause / coreCode / trigger entries within the same batch
|
|
129
|
+
- If two entries share 80%+ content, **merge into one** or split into **primary + extends supplementary** entries
|
|
130
|
+
- Primary entry contains complete core content; supplementary entry contains only the differences, referencing the primary trigger in `_relations.extends`
|
|
131
|
+
- The system only detects fusion between "candidates vs existing DB entries" — **it does NOT check intra-batch redundancy** — Agent must self-enforce
|
|
132
|
+
|
|
133
|
+
**Example**: Two routing knowledge entries (registration flow + dispatch supplement) should be structured as:
|
|
134
|
+
1. Primary: Complete route registration pattern (register + open + doc sync)
|
|
135
|
+
2. Supplementary: Only deepLink/Modal/Tab stack differences, `_relations.extends → primary trigger`
|
|
127
136
|
|
|
128
137
|
---
|
|
129
138
|
|
|
130
|
-
##
|
|
139
|
+
## Post-Submission Management
|
|
131
140
|
|
|
132
|
-
|
|
|
141
|
+
| Need | Tool |
|
|
133
142
|
|------|------|
|
|
134
|
-
|
|
|
135
|
-
|
|
|
136
|
-
|
|
|
137
|
-
|
|
|
143
|
+
| Check candidate status | `autosnippet_knowledge(operation=list)` |
|
|
144
|
+
| Diagnose missing fields | `autosnippet_enrich_candidates` |
|
|
145
|
+
| Review/publish | `autosnippet_knowledge_lifecycle(operation=approve/publish/fast_track)` |
|
|
146
|
+
| Search existing knowledge to avoid duplicates | `autosnippet_search(mode=context, query=...)` |
|
|
138
147
|
|
|
139
148
|
---
|
|
140
149
|
|
|
141
|
-
##
|
|
150
|
+
## Kind Routing & Pipeline Impact
|
|
142
151
|
|
|
143
|
-
| kind |
|
|
144
|
-
|
|
145
|
-
| `rule` |
|
|
146
|
-
| `pattern` |
|
|
147
|
-
| `fact` |
|
|
152
|
+
| kind | Purpose | Pipeline Output |
|
|
153
|
+
|------|---------|-----------------|
|
|
154
|
+
| `rule` | Coding conventions, constraints | → Channel A (.mdc rule files) |
|
|
155
|
+
| `pattern` | Code patterns, usage | → Channel B (.mdc pattern files + Snippet) |
|
|
156
|
+
| `fact` | Project facts, architecture decisions | → Search/Guard context, no direct file output |
|
|
148
157
|
|
|
149
|
-
`doClause`
|
|
158
|
+
`doClause` is a **hard dependency** for Channel A+B — missing this field means .mdc files cannot be generated at all.
|
|
150
159
|
|
|
151
160
|
---
|
|
152
161
|
|
|
153
|
-
##
|
|
162
|
+
## Example: Submit One Entry
|
|
154
163
|
|
|
155
164
|
```json
|
|
156
165
|
{
|
|
157
|
-
"title": "Network Monitor —
|
|
158
|
-
"description": "
|
|
166
|
+
"title": "Network Monitor — Connectivity Listener",
|
|
167
|
+
"description": "Monitor network connectivity changes using NWPathMonitor",
|
|
159
168
|
"trigger": "@NetworkMonitor",
|
|
160
169
|
"language": "swift",
|
|
161
170
|
"kind": "pattern",
|
|
162
171
|
"category": "Network",
|
|
163
172
|
"knowledgeType": "api-usage",
|
|
164
|
-
"doClause": "
|
|
165
|
-
"dontClause": "
|
|
166
|
-
"whenClause": "
|
|
173
|
+
"doClause": "Use NWPathMonitor to observe network status changes; dispatch UI updates to the main queue",
|
|
174
|
+
"dontClause": "Do not use the deprecated Reachability library; do not update UI directly on background threads",
|
|
175
|
+
"whenClause": "When the app needs real-time network connectivity awareness",
|
|
167
176
|
"coreCode": "let monitor = NWPathMonitor()\nmonitor.pathUpdateHandler = { path in\n DispatchQueue.main.async {\n self.isConnected = path.status == .satisfied\n }\n}\nmonitor.start(queue: DispatchQueue.global())",
|
|
168
177
|
"headers": ["import Network"],
|
|
169
|
-
"usageGuide": "###
|
|
178
|
+
"usageGuide": "### When to Use\n- App needs real-time network status\n- Initialize once at launch\n\n### Key Points\n- Access via singleton sharedMonitor\n- start() begins monitoring, cancel() stops\n- Callback runs on global queue; switch to main thread for UI updates",
|
|
170
179
|
"content": {
|
|
171
|
-
"markdown": "NWPathMonitor
|
|
172
|
-
"rationale": "Apple
|
|
180
|
+
"markdown": "NWPathMonitor is the recommended network status monitoring API for iOS 12+, replacing deprecated Reachability.",
|
|
181
|
+
"rationale": "Apple-recommended, thread-safe, supports cellular/WiFi/wired detection."
|
|
173
182
|
},
|
|
174
183
|
"reasoning": {
|
|
175
|
-
"whyStandard": "Apple Developer Documentation
|
|
184
|
+
"whyStandard": "Apple Developer Documentation recommended approach, replacing SCNetworkReachability",
|
|
176
185
|
"sources": ["Apple Developer Documentation - NWPathMonitor"],
|
|
177
186
|
"confidence": 0.95
|
|
178
187
|
}
|
|
@@ -1,89 +1,87 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: autosnippet-devdocs
|
|
3
|
-
description:
|
|
3
|
+
description: Generate and publish project Wiki documentation using autosnippet_wiki MCP tool (plan → write → finalize). Use when user says "generate wiki/docs", "write documentation", or agent needs to produce structured project documentation from the knowledge base.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# AutoSnippet —
|
|
6
|
+
# AutoSnippet — Wiki Documentation Generation
|
|
7
7
|
|
|
8
|
-
This skill
|
|
8
|
+
This skill guides the agent through generating structured **Wiki documentation** from the AutoSnippet knowledge base using the `autosnippet_wiki` MCP tool.
|
|
9
9
|
|
|
10
10
|
## When to use this skill
|
|
11
11
|
|
|
12
|
-
-
|
|
13
|
-
- After
|
|
14
|
-
-
|
|
15
|
-
- After
|
|
16
|
-
- When the user says "保存这个分析" / "记录一下" / "save this to KB"
|
|
12
|
+
- User asks to **generate project documentation** or **wiki**
|
|
13
|
+
- After a **cold-start bootstrap** completes — produce docs from newly captured knowledge
|
|
14
|
+
- When the user says "generate docs" / "write wiki" / "create documentation"
|
|
15
|
+
- After significant **knowledge base changes** — refresh documentation
|
|
17
16
|
|
|
18
|
-
## MCP
|
|
17
|
+
## MCP Tools
|
|
19
18
|
|
|
20
|
-
| Tool | Description |
|
|
21
|
-
|
|
22
|
-
| `
|
|
23
|
-
| `
|
|
19
|
+
| Tool | Operation | Description |
|
|
20
|
+
|------|-----------|-------------|
|
|
21
|
+
| `autosnippet_wiki` | `plan` | Plan topics + data packages (returns topic list + per-topic data for writing) |
|
|
22
|
+
| `autosnippet_wiki` | `finalize` | Complete generation (write meta.json, dedup check, validate completeness) |
|
|
23
|
+
| `autosnippet_search` | — | Search knowledge for additional context during writing |
|
|
24
|
+
| `autosnippet_knowledge` | `get` | Retrieve full Recipe content for reference |
|
|
24
25
|
|
|
25
|
-
##
|
|
26
|
+
## Workflow
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
### Step 1: Plan topics
|
|
28
29
|
|
|
29
30
|
```json
|
|
30
31
|
{
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"description": "冷启动耗时 8s 的根因分析和优化方案",
|
|
34
|
-
"tags": ["debug-report", "performance"],
|
|
35
|
-
"scope": "project-specific"
|
|
32
|
+
"operation": "plan",
|
|
33
|
+
"language": "en"
|
|
36
34
|
}
|
|
37
35
|
```
|
|
38
36
|
|
|
39
|
-
|
|
37
|
+
Returns:
|
|
38
|
+
- **topics[]** — Recommended documentation topics based on knowledge base content
|
|
39
|
+
- **dataPackages** — Per-topic data bundles (related Recipes, code patterns, architecture info)
|
|
40
|
+
- **sessionId** — Session identifier for the finalize step
|
|
40
41
|
|
|
41
|
-
|
|
42
|
-
|-------|-------------|
|
|
43
|
-
| `title` | Document title (Chinese or English) |
|
|
44
|
-
| `markdown` | Full Markdown content |
|
|
45
|
-
|
|
46
|
-
### Optional fields
|
|
47
|
-
|
|
48
|
-
| Field | Default | Description |
|
|
49
|
-
|-------|---------|-------------|
|
|
50
|
-
| `description` | `""` | One-line summary |
|
|
51
|
-
| `tags` | `[]` | Labels for filtering: `adr`, `debug-report`, `design-doc`, `research`, `performance`, `refactoring` |
|
|
52
|
-
| `scope` | `project-specific` | `universal` or `project-specific` |
|
|
42
|
+
### Step 2: Write articles
|
|
53
43
|
|
|
54
|
-
|
|
44
|
+
For each topic in the plan:
|
|
45
|
+
1. Read the **dataPackage** for that topic
|
|
46
|
+
2. Write a well-structured Markdown article to the wiki directory (`AutoSnippet/wiki/`)
|
|
47
|
+
3. Use Recipe content as source of truth — cite Recipe titles
|
|
48
|
+
4. Follow the structure: Overview → Details → Code Examples → Related Topics
|
|
55
49
|
|
|
56
|
-
|
|
57
|
-
|-----|----------|
|
|
58
|
-
| `adr` | Architecture Decision Record |
|
|
59
|
-
| `debug-report` | Bug investigation / root cause analysis |
|
|
60
|
-
| `design-doc` | Module/feature design document |
|
|
61
|
-
| `research` | Technology research or investigation |
|
|
62
|
-
| `performance` | Benchmark results, profiling analysis |
|
|
63
|
-
| `refactoring` | Refactoring plan or post-mortem |
|
|
64
|
-
| `migration` | Migration guide or plan |
|
|
65
|
-
| `meeting-notes` | Technical meeting summary |
|
|
50
|
+
### Step 3: Finalize
|
|
66
51
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"operation": "finalize",
|
|
55
|
+
"sessionId": "<from plan>",
|
|
56
|
+
"articlesWritten": ["AutoSnippet/wiki/topic-1.md", "AutoSnippet/wiki/topic-2.md"]
|
|
57
|
+
}
|
|
58
|
+
```
|
|
70
59
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
60
|
+
This triggers:
|
|
61
|
+
- **meta.json** generation — topic index with cross-references
|
|
62
|
+
- **Dedup check** — detect overlapping articles
|
|
63
|
+
- **Completeness validation** — ensure all planned topics are covered
|
|
74
64
|
|
|
75
|
-
##
|
|
65
|
+
## Writing guidelines
|
|
76
66
|
|
|
77
67
|
- Use **clear headings** (`##`, `###`) — helps search and scanning
|
|
78
|
-
- Include a **summary section** at the top
|
|
68
|
+
- Include a **summary section** at the top of each article
|
|
79
69
|
- Reference **file paths** and **class names** concretely — improves search relevance
|
|
80
|
-
-
|
|
81
|
-
- For
|
|
70
|
+
- Cite **Recipe triggers** (e.g., `@bilidili-feature-url-routing`) as knowledge sources
|
|
71
|
+
- For architecture docs: Context → Design → Implementation → Trade-offs
|
|
72
|
+
- For pattern docs: When to Use → How to Use → Code Example → Anti-patterns
|
|
73
|
+
|
|
74
|
+
## Language parameter
|
|
75
|
+
|
|
76
|
+
| Value | Effect |
|
|
77
|
+
|-------|--------|
|
|
78
|
+
| `"en"` | English documentation (default) |
|
|
79
|
+
| `"zh"` | Chinese documentation |
|
|
82
80
|
|
|
83
81
|
## Related Skills
|
|
84
82
|
|
|
85
83
|
| Skill | When to use |
|
|
86
84
|
|-------|-------------|
|
|
87
|
-
| `autosnippet-create` |
|
|
88
|
-
| `autosnippet-devdocs` (this) |
|
|
89
|
-
| `autosnippet-recipes` | Looking up existing knowledge |
|
|
85
|
+
| `autosnippet-create` | Submitting **code patterns/recipes** to KB (not documents) |
|
|
86
|
+
| `autosnippet-devdocs` (this) | Generating **Wiki documentation** from KB |
|
|
87
|
+
| `autosnippet-recipes` | Looking up existing knowledge for reference |
|
|
@@ -8,11 +8,11 @@ if [[ "$1" == "--brief" ]]; then
|
|
|
8
8
|
cat <<'EOF'
|
|
9
9
|
📋 AutoSnippet Task Rules (MANDATORY):
|
|
10
10
|
• Prime EVERY message: autosnippet_task({ operation: "prime" }) FIRST.
|
|
11
|
-
• Create task for non-trivial work (≥2 files OR ≥10 lines).
|
|
12
|
-
• Handle in-progress tasks before new work. Close/
|
|
11
|
+
• Create task for non-trivial work (≥2 files OR ≥10 lines). Create → code → close.
|
|
12
|
+
• Handle in-progress tasks before new work. Close/fail ALL on session end.
|
|
13
13
|
• You are the task operator — user speaks naturally, you run task operations.
|
|
14
14
|
• User agrees/disagrees → record_decision immediately.
|
|
15
|
-
• "fix bug"/"implement" → create→
|
|
15
|
+
• "fix bug"/"implement" → create→code→close | "pause"/"abandon" → fail
|
|
16
16
|
EOF
|
|
17
17
|
else
|
|
18
18
|
# Full mode — SessionStart
|
|
@@ -27,9 +27,8 @@ else
|
|
|
27
27
|
|
|
28
28
|
📋 MUST:
|
|
29
29
|
• Create task for non-trivial work (≥2 files OR ≥10 lines) BEFORE starting
|
|
30
|
-
•
|
|
31
|
-
•
|
|
32
|
-
• Close or defer ALL in_progress tasks before session ends
|
|
30
|
+
• Close when done with meaningful reason
|
|
31
|
+
• Close or fail ALL in_progress tasks before session ends
|
|
33
32
|
|
|
34
33
|
🚫 NEVER:
|
|
35
34
|
• Skip prime
|
|
@@ -38,24 +37,20 @@ else
|
|
|
38
37
|
• Leave tasks in in_progress when session ends
|
|
39
38
|
|
|
40
39
|
📖 User Says → You Run:
|
|
41
|
-
• "fix bug" / "implement" → create →
|
|
40
|
+
• "fix bug" / "implement" → create → code → close
|
|
42
41
|
• "continue" → resume in-progress → code → close
|
|
43
|
-
• "pause" →
|
|
44
|
-
• "abandon" → fail(id, reason)
|
|
45
|
-
• "break down" → decompose(id, subtasks)
|
|
46
|
-
• "what's next" → ready() → present list
|
|
42
|
+
• "pause" / "abandon" → fail(id, reason)
|
|
47
43
|
• "agreed" → record_decision(...)
|
|
48
44
|
• Quick question → No task. Just answer.
|
|
49
45
|
|
|
50
|
-
💡 When in doubt → create a task.
|
|
46
|
+
💡 When in doubt → create a task.
|
|
51
47
|
|
|
52
48
|
📌 User agrees/disagrees with plan → autosnippet_task({ operation: "record_decision" }) immediately
|
|
53
49
|
|
|
54
50
|
✅ Session end checklist:
|
|
55
|
-
[ ] Close every
|
|
56
|
-
[ ]
|
|
51
|
+
[ ] Close every task with reason
|
|
52
|
+
[ ] Fail incomplete tasks with notes
|
|
57
53
|
[ ] Verify zero in_progress
|
|
58
|
-
[ ] Mention ready tasks for next session
|
|
59
54
|
|
|
60
55
|
🔎 Search knowledge: autosnippet_search({ query: "..." })
|
|
61
56
|
📚 Do NOT modify AutoSnippet/recipes/ or .autosnippet/ directly
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
cat <<'EOF'
|
|
7
7
|
{
|
|
8
|
-
"additional_context": "[AutoSnippet Task Rules]\n\n⚡ FIRST: Call autosnippet_task({ \"operation\": \"prime\" }) on EVERY message. No exceptions.\n\n
|
|
8
|
+
"additional_context": "[AutoSnippet Task Rules]\n\n⚡ FIRST: Call autosnippet_task({ \"operation\": \"prime\" }) on EVERY message. No exceptions.\n\n🔑 CRITICAL: YOU Operate autosnippet_task — The User Doesn't\n• WRONG: \"You can run autosnippet_task to create a task\"\n• RIGHT: (you run create yourself and tell the user \"Created task asd-42\")\n\n📋 MUST:\n• Create task for non-trivial work (≥2 files OR ≥10 lines) BEFORE starting\n• Close when done with meaningful reason\n• Close or fail ALL in_progress tasks before session ends\n\n🚫 NEVER:\n• Skip prime\n• Start new work with open in_progress tasks\n• Tell user to run task commands (YOU are the operator)\n• Leave tasks in in_progress when session ends\n\n📖 User Says → You Run:\n• \"fix bug\" / \"implement\" → create → code → close\n• \"continue\" → resume in-progress → code → close\n• \"pause\" / \"abandon\" → fail(id, reason)\n• \"agreed\" → record_decision(...)\n• Quick question → No task. Just answer.\n\n💡 When in doubt → create a task.\n\n📌 User agrees/disagrees with plan → autosnippet_task({ operation: \"record_decision\" }) immediately\n\n✅ Session end checklist: close all tasks → fail incomplete → verify zero in_progress"
|
|
9
9
|
}
|
|
10
10
|
EOF
|
package/templates/guard-ci.yml
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# AutoSnippet Guard CI/CD Check
|
|
2
2
|
# Auto-generated by AutoSnippet. Do not edit manually.
|
|
3
|
-
#
|
|
3
|
+
# Automatically runs Guard compliance checks on push and PR.
|
|
4
4
|
#
|
|
5
|
-
#
|
|
5
|
+
# Usage: Copy this file to your project's .github/workflows/ directory.
|
|
6
6
|
|
|
7
7
|
name: AutoSnippet Guard Check
|
|
8
8
|
|
|
@@ -7,7 +7,7 @@ Access the knowledge base through MCP tools.
|
|
|
7
7
|
|
|
8
8
|
## MCP Tools
|
|
9
9
|
|
|
10
|
-
- `autosnippet_task` — Task & decision management (prime/create/
|
|
10
|
+
- `autosnippet_task` — Task & decision management (prime/create/close/fail/record_decision)
|
|
11
11
|
- `autosnippet_search` — Search knowledge (mode: auto/context/keyword/semantic)
|
|
12
12
|
- `autosnippet_knowledge` — Knowledge CRUD (operation: list/get/insights)
|
|
13
13
|
- `autosnippet_submit_knowledge` — Submit knowledge candidate
|
|
@@ -15,6 +15,7 @@ Access the knowledge base through MCP tools.
|
|
|
15
15
|
- `autosnippet_skill` — Skill management (list/load)
|
|
16
16
|
- `autosnippet_structure` — Project structure discovery
|
|
17
17
|
- `autosnippet_bootstrap` — Project cold-start & scan
|
|
18
|
+
- `autosnippet_panorama` — Project panorama (operation: overview/module/gaps/health)
|
|
18
19
|
- `autosnippet_health` — Service health & KB stats
|
|
19
20
|
|
|
20
21
|
## Constraints
|
|
@@ -5,19 +5,17 @@ Users speak naturally; you translate to task operations. Never tell users to cal
|
|
|
5
5
|
## Task Rules (MANDATORY)
|
|
6
6
|
|
|
7
7
|
1. **Prime EVERY message** — `autosnippet_task({ operation: "prime" })` FIRST.
|
|
8
|
-
2. **Create task for non-trivial work** — ≥2 files OR ≥10 lines → `create` →
|
|
8
|
+
2. **Create task for non-trivial work** — ≥2 files OR ≥10 lines → `create` → code → `close`.
|
|
9
9
|
3. **Decision persistence** — User agrees/disagrees → `record_decision` immediately.
|
|
10
|
-
4. **Session end** — Close or
|
|
10
|
+
4. **Session end** — Close or fail ALL tasks. Zero in_progress on exit.
|
|
11
11
|
5. **You are the operator** — Never tell users to call autosnippet_task.
|
|
12
12
|
6. **Skip task for**: Quick questions, single-file trivial fixes (<10 lines), code explanation.
|
|
13
13
|
|
|
14
14
|
| User Says | You Run |
|
|
15
15
|
|---|---|
|
|
16
|
-
| "fix bug" / "implement" | `create` →
|
|
16
|
+
| "fix bug" / "implement" | `create` → code → `close` |
|
|
17
17
|
| "continue" | resume in-progress → `close` |
|
|
18
|
-
| "pause" / "abandon" | `
|
|
19
|
-
| "break down" | `decompose(id, subtasks)` |
|
|
20
|
-
| "what's next" | `ready()` → present |
|
|
18
|
+
| "pause" / "abandon" | `fail(id, reason)` |
|
|
21
19
|
| "agreed" | `record_decision(...)` |
|
|
22
20
|
|
|
23
21
|
## Knowledge Rules
|
|
@@ -34,6 +32,7 @@ Users speak naturally; you translate to task operations. Never tell users to cal
|
|
|
34
32
|
- `autosnippet_submit_knowledge` — Submit knowledge candidate
|
|
35
33
|
- `autosnippet_guard` — Code compliance check
|
|
36
34
|
- `autosnippet_skill` — Load project skills (list/load)
|
|
35
|
+
- `autosnippet_panorama` — Project panorama (overview/module/gaps/health)
|
|
37
36
|
- `autosnippet_health` — Service health & KB stats
|
|
38
37
|
|
|
39
38
|
## Context Pressure
|
|
@@ -158,8 +158,7 @@ V2 知识库中的 Recipe 按 `knowledgeType` 自动归入三类 kind,影响
|
|
|
158
158
|
| 工具 | 说明 |
|
|
159
159
|
|------|------|
|
|
160
160
|
| `autosnippet_search` | 统合搜索(mode=auto: BM25 + 语义融合,mode=context: 智能上下文检索) |
|
|
161
|
-
| `autosnippet_submit_knowledge` |
|
|
162
|
-
| `autosnippet_submit_knowledge_batch` | 批量候选提交 |
|
|
161
|
+
| `autosnippet_submit_knowledge` | 统一知识提交(单条/批量/文档)。使用 `items` 数组格式传入 1~N 条。文档模式设 `knowledgeType: 'dev-document'` 仅需 title + markdown |
|
|
163
162
|
| `autosnippet_knowledge(operation=confirm_usage)` | 确认 Recipe 被采纳/应用 |
|
|
164
163
|
| `autosnippet_knowledge(operation=insights)` | 获取 Recipe 质量洞察(只读) |
|
|
165
164
|
|