Skip to content

Wire Claude Code automation into the stack#3

Open
pppmppp wants to merge 9 commits into
mate-academy:mainfrom
pppmppp:main
Open

Wire Claude Code automation into the stack#3
pppmppp wants to merge 9 commits into
mate-academy:mainfrom
pppmppp:main

Conversation

@pppmppp

@pppmppp pppmppp commented Jun 23, 2026

Copy link
Copy Markdown

Summary

  • Connected the fetch MCP server at project scope (.mcp.json), scoped to mcp__fetch__fetch only via .claude/settings.json
  • Added an add-resource project skill in .claude/skills/add-resource/ for scaffolding new REST resources
  • Added a /review-route custom command in .claude/commands/ that runs a convention checklist against any route file
  • Added a PostToolUse hook in .claude/settings.json that auto-runs eslint --fix after every .js file edit
  • Ran DELETE /users/:id implementation headless via claude -p with --allowedTools "Read,Edit,Bash(npm test)"
  • Added NOTES.md explaining each automation choice
  • Fixed code-review findings: integer validation on all :id routes (400 for non-integer input), deleteUser delegates to getUser, return type consistent with updateUser

Test plan

  • All 5 existing tests pass (npm test)
  • .mcp.json and .claude/settings.json are committed and valid JSON
  • skills/add-resource/SKILL.md exists with name and description frontmatter
  • .claude/commands/review-route.md exists and contains $ARGUMENTS
  • Hook in settings.json matches Write|Edit on PostToolUse
  • NOTES.md present and answers all five questions

🤖 Generated with Claude Code

Jeremy Skirrow and others added 9 commits June 23, 2026 15:42
Wires in @modelcontextprotocol/server-fetch so Claude Code can pull
Express, Node.js test runner, and ESLint docs directly during sessions
on this repo.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Allows mcp__fetch__fetch explicitly rather than blanket-allowing the
entire server, so only HTTP GET/fetch operations are permitted.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Encodes the route file structure, store function pattern, error-response
shape ({ error: "message" }, 400/404/201), server.js mount convention,
and test structure (node:test + supertest + store.reset per test).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Opening phrase 'Add a resource' maps to 'add-resource'; previous
'Adding a new REST resource' caused the model to guess
'add-new-rest-resource' and fail with Unknown skill.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Built-in skills require an explicit name: key so Claude Code registers
the invocation name; without it the model synthesises a name from the
description and misses.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Flat .claude/skills/*.md files are not registered as invocable skills;
the correct format is .claude/skills/<name>/SKILL.md — same convention
used by all built-in and plugin skills.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Checks a route file against the project's conventions: error-response
shape, early-return pattern, Number(req.params.id), status codes,
store-only data access, and test coverage with store.reset().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fires on Write|Edit, extracts the file path from the hook JSON, and
runs eslint --fix on .js files only (case pattern match). Non-JS files
are silently skipped; eslint errors are suppressed so the hook never
blocks Claude.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add DELETE /users/:id route (204 on success, 404 if not found)
- Add deleteUser() to store, delegating lookup to getUser() to avoid predicate duplication
- Validate :id as an integer on all parameterised routes (GET, PUT, DELETE), returning 400 for non-integer input instead of a misleading 404
- Add NOTES.md summarising MCP, skill, command, hook, and headless run choices

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant