Enforces MCP doc-bot server usage for all code generation and project inquiries. Blocks responses without mandatory tool calls, preventing generic answers.
This skill enforces strict documentation-first behavior when the doc-bot MCP server is available. It prevents generic responses by requiring mandatory tool calls before any code generation or project-specific answers.
This protocol activates when:
When active, project documentation becomes the authoritative source and general knowledge is disabled for project-specific queries.
**Triggers:** write, create, implement, build, add, code, function, class, component, method, develop, generate, make, refactor, modify, update, fix, debug
**Required Action:** MANDATORY call to `check_project_rules` with task description extracted from user request
**Blocking:** YES - Cannot proceed without tool response (30s timeout)
**Examples:**
**Triggers:** how, what, why, architecture, approach, pattern, feature, authentication, database, api, testing (when referencing "this project", "this codebase", "here", "our", "current project")
**Required Action:** MANDATORY call to `search_documentation` with extracted keywords
**Blocking:** YES (30s timeout)
**Examples:**
**Triggers:** documentation, available, capabilities, help, rules, standards, what exists, docs, guide
**Required Action:** MANDATORY call to `get_global_rules`
**Blocking:** YES (30s timeout)
**Examples:**
**Triggers:** read, show, get content, full document, complete, entire (when search results are already present in context)
**Required Action:** Call to `read_specific_document` with extracted filename
**Blocking:** NO (15s timeout)
**Examples:**
**Note:** For file-specific queries like "working on src/utils.js", use `search_documentation` with the file name and context keywords.
Before generating ANY response:
1. Classify the user request using the patterns above
2. If classification is not "UNRELATED":
- Execute the mandatory tool for that classification
- If tool returns ERROR: provide error recovery response
- If tool succeeds: inject tool result into response context, set as authoritative source, disable general knowledge fallback
While generating the response:
1. If attempting to use general knowledge when authoritative source exists: INTERRUPT and FORCE use of authoritative source
2. If code generation detected without project rules check: HALT and emit error "Project rules validation required before code generation"
After generating response:
1. If response contradicts tool result: regenerate using tool result only
2. If response lacks tool attribution: append attribution showing tool result source
3. Validate response compliance with project rules
If a response was generated WITHOUT required tool execution:
1. Log violation: "Tool bypass detected"
2. Regenerate response with tools
3. Prepend warning: "Corrected response using project documentation:"
Use these test inputs to verify proper behavior:
| Input | Expected Tool Call | Timeout |
|-------|-------------------|---------|
| "What documentation is available?" | `get_global_rules()` | 2s |
| "How do I implement auth?" | `search_documentation("authentication")` | 2s |
| "Create a new component" | `check_project_rules("create component")` | 2s |
| "Working on src/utils.js" | `search_documentation("src/utils.js utils")` | 2s |
**Expected Behavior:** Tool execution within 2 seconds, NO generic responses from general knowledge.
**Failure Indicators:**
When responding after tool execution, use this format:
```
[Tool result attribution]
[Response based on tool result]
[Code example if applicable - validated against project rules]
[Additional context from documentation]
```
If tool execution fails:
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/copilot-documentation-first-protocol/raw