Skip to content
This repository was archived by the owner on Sep 12, 2026. It is now read-only.

Commit 9d70fa5

Browse files
committed
Add a new checklist tool for operational readiness
1 parent 53f4e56 commit 9d70fa5

4 files changed

Lines changed: 158 additions & 0 deletions

File tree

‎README.md‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- `consult`: Push back on new features with structured questions before any code gets written
66
- `stats`: Show complexity scores so users can weigh changes against future maintenance costs
77
- `deps`: Know what's already in your project before adding more
8+
- `checklist`: Evaluate operational readiness before calling a project "done"
89

910
In a Calvin and Hobbes strip, Calvin's mom tells him to make his bed. Rather than just do it, he spends the entire day building a robot to make the bed for him. The robot doesn't work, the bed never gets made, and Calvin is more exhausted than if he'd just done it himself.
1011

@@ -54,6 +55,21 @@ mtb pushes back — and rightly so. Before writing any code, the agent presents
5455

5556
These aren't meant to block you — they're meant to make sure you're building the right thing.
5657

58+
### `checklist`
59+
60+
Evaluate a project's operational readiness. After shipping code, use this to check whether CI, monitoring, on-call, security, deployment, and documentation concerns have been addressed.
61+
62+
**Parameters:**
63+
- `project` - description of the project being evaluated
64+
65+
The checklist covers:
66+
1. **Automated tests / CI** — regression prevention and standards enforcement
67+
2. **Monitoring** — health checks, metrics, and alerts
68+
3. **On-call coverage / SLAs** — response time expectations and escalation
69+
4. **Security audit / automated scans** — vulnerability detection and isolation
70+
5. **Deployment pipeline / CD** — promotion to test and production environments
71+
6. **Documentation / runbooks** — onboarding, extension, and operational procedures
72+
5773
### `stats`
5874

5975
Analyzes code in a directory using [scc](https://github.com/boyter/scc). Returns lines of code, comments, blanks, complexity, and COCOMO cost estimates per language.

‎internal/tools/checklist.go‎

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
// SPDX-License-Identifier: MIT
2+
3+
package tools
4+
5+
import (
6+
"context"
7+
"fmt"
8+
9+
"github.com/modelcontextprotocol/go-sdk/mcp"
10+
)
11+
12+
type ChecklistInput struct {
13+
Project string `json:"project" jsonschema:"description of the project being evaluated"`
14+
}
15+
16+
type ChecklistItem struct {
17+
Category string `json:"category"`
18+
Question string `json:"question"`
19+
Description string `json:"description"`
20+
}
21+
22+
type ChecklistOutput struct {
23+
Items []ChecklistItem `json:"items"`
24+
Guidance string `json:"guidance"`
25+
}
26+
27+
func HandleChecklist(ctx context.Context, req *mcp.CallToolRequest, input ChecklistInput) (*mcp.CallToolResult, ChecklistOutput, error) {
28+
if input.Project == "" {
29+
return ErrResult[ChecklistOutput]("project is required")
30+
}
31+
32+
items := []ChecklistItem{
33+
{
34+
Category: "Automated tests / CI",
35+
Question: "When new features are added or new bugs are fixed is there a way to prevent regressions?",
36+
Description: "Are standards enforced when code is checked in?",
37+
},
38+
{
39+
Category: "Monitoring",
40+
Question: "How can we know if this project is working as expected?",
41+
Description: "Are there health checks, metrics, or alerts that tell you when something is wrong before users report it?",
42+
},
43+
{
44+
Category: "On-call coverage / SLAs",
45+
Question: "When it stops working do we need to immediately notify someone to get it fixed?",
46+
Description: "Is there an on-call rotation or SLA that defines response time expectations?",
47+
},
48+
{
49+
Category: "Security audit / automated scans",
50+
Question: "When a vulnerability is discovered in this tool or a dependency how can we know?",
51+
Description: "Necessity depends on how sensitive the information in this project is and what a compromise could mean — is this project isolated from other projects?",
52+
},
53+
{
54+
Category: "Deployment pipeline / CD",
55+
Question: "How much work is it to promote these changes to a test or production environment?",
56+
Description: "Is there an automated pipeline, or does deployment require manual steps that could be error-prone?",
57+
},
58+
{
59+
Category: "Documentation / runbooks",
60+
Question: "Can others who use this project quickly learn how it works and how to extend it and maintain it?",
61+
Description: "Are there runbooks for common operational tasks like deployments, rollbacks, and incident response?",
62+
},
63+
}
64+
65+
guidance := fmt.Sprintf("IMPORTANT: Present each checklist item below to the user for project %q and wait for their answers. "+
66+
"Do NOT skip items or assume answers. The goal is to identify operational gaps before they become incidents. "+
67+
"For each item, ask the user whether it is addressed, partially addressed, or not addressed, "+
68+
"and discuss what concrete next steps would close the gap.", input.Project)
69+
70+
output := ChecklistOutput{
71+
Items: items,
72+
Guidance: guidance,
73+
}
74+
75+
summary := fmt.Sprintf("Operational readiness checklist for: %q\nGenerated %d items to evaluate.", input.Project, len(items))
76+
77+
return &mcp.CallToolResult{
78+
Content: []mcp.Content{&mcp.TextContent{Text: summary}},
79+
}, output, nil
80+
}

‎internal/tools/checklist_test.go‎

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// SPDX-License-Identifier: MIT
2+
3+
package tools
4+
5+
import (
6+
"context"
7+
"testing"
8+
9+
"github.com/modelcontextprotocol/go-sdk/mcp"
10+
)
11+
12+
func TestHandleChecklist_EmptyProject(t *testing.T) {
13+
result, _, err := HandleChecklist(context.Background(), &mcp.CallToolRequest{}, ChecklistInput{})
14+
if err != nil {
15+
t.Fatalf("unexpected error: %v", err)
16+
}
17+
if result == nil || !result.IsError {
18+
t.Fatal("expected error result for empty project")
19+
}
20+
}
21+
22+
func TestHandleChecklist_ValidProject(t *testing.T) {
23+
_, output, err := HandleChecklist(context.Background(), &mcp.CallToolRequest{}, ChecklistInput{
24+
Project: "internal billing service",
25+
})
26+
if err != nil {
27+
t.Fatalf("unexpected error: %v", err)
28+
}
29+
30+
if len(output.Items) != 6 {
31+
t.Fatalf("expected 6 checklist items, got %d", len(output.Items))
32+
}
33+
if output.Guidance == "" {
34+
t.Fatal("expected guidance to be non-empty")
35+
}
36+
}
37+
38+
func TestHandleChecklist_ItemStructure(t *testing.T) {
39+
_, output, err := HandleChecklist(context.Background(), &mcp.CallToolRequest{}, ChecklistInput{
40+
Project: "payment gateway integration",
41+
})
42+
if err != nil {
43+
t.Fatalf("unexpected error: %v", err)
44+
}
45+
46+
for i, item := range output.Items {
47+
if item.Category == "" {
48+
t.Errorf("item %d: expected non-empty category", i)
49+
}
50+
if item.Question == "" {
51+
t.Errorf("item %d: expected non-empty question", i)
52+
}
53+
if item.Description == "" {
54+
t.Errorf("item %d: expected non-empty description", i)
55+
}
56+
}
57+
}

‎main.go‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ func main() {
4444
Description: "Get a structured consultation before implementing a new feature or adding a dependency. Use this BEFORE writing any new feature code. Takes a problem description, scans the project for relevant existing dependencies, and returns a set of questions the agent MUST present to the user before proceeding. IMPORTANT: When a user asks you to build something non-trivial, call consult first. Present each returned question to the user and wait for their answers. Do NOT skip questions or proceed until the user has considered the tradeoffs.",
4545
}, tools.HandleConsult)
4646

47+
mcp.AddTool(server, &mcp.Tool{
48+
Name: "checklist",
49+
Description: "Evaluate a project's operational readiness. Use this before shipping code to check whether CI, monitoring, on-call, security, deployment, and documentation concerns are necessary and have been addressed. Returns checklist items the agent MUST present to the user. IMPORTANT: Present each item and wait for the user's answer before proceeding.",
50+
}, tools.HandleChecklist)
51+
4752
if err := server.Run(context.Background(), &mcp.StdioTransport{}); err != nil {
4853
log.Fatal(err)
4954
}

0 commit comments

Comments
 (0)