Add lint script and CLAUDE.md for autonomous workflow#2
Conversation
Add type-checking step to CI pipeline and project documentation to support autonomous agent development with clear contribution rules. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR adds a TypeScript type-check “lint” step to the project’s CI pipeline and introduces a CLAUDE.md file describing repo architecture and autonomous/agent contribution workflow.
Changes:
- Add
npm run lintscript (tsc --noEmit) for type-checking. - Run the new lint step in GitHub Actions CI (Node 20/22).
- Add
CLAUDE.mdwith architecture notes, constraints, and agent workflow rules.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| package.json | Adds lint script to run TypeScript type-checking without emitting artifacts. |
| .github/workflows/ci.yml | Inserts npm run lint into the CI job before build/test across Node 20 and 22. |
| CLAUDE.md | Adds agent-facing documentation: architecture map, constraints, dev commands, and workflow rules. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,37 @@ | |||
| # substack-mcp | |||
|
|
|||
| MCP server for Substack — read posts, manage drafts, create notes. No publish or delete by design. | |||
There was a problem hiding this comment.
The intro line says "No publish or delete by design", but this repo does publish Substack Notes immediately (e.g., create_note / create_note_with_link in src/server.ts and README). This wording is misleading for agents; consider clarifying it to "cannot publish or delete posts" while calling out that notes are published immediately.
| ## Key constraints | ||
| - Read and draft operations only — no publish or delete capabilities by design | ||
| - Uses `connect.sid` session cookie for auth (not `substack.sid` on custom domains) |
There was a problem hiding this comment.
In "Key constraints", the bullets claim there are no publish capabilities and that auth uses connect.sid (not substack.sid on custom domains). The implementation actually sends both cookies (connect.sid and substack.sid) and the server does publish notes immediately. Please update these bullets to match the current behavior so agent guidance is accurate.
… auth - Intro: clarify that notes publish immediately (Substack has no note-draft state), while posts remain read/draft-only - Key constraints: split the publish bullet (posts vs notes) and correct the auth bullet — client sends both connect.sid and substack.sid cookies set to the same session token Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| node-version: ${{ matrix.node-version }} | ||
| cache: npm | ||
| - run: npm ci | ||
| - run: npm run lint |
There was a problem hiding this comment.
CI now runs npm run lint (tsc --noEmit) and then npm run build (tsc). Since tsc already type-checks and fails the job on TS errors, this adds a second full compile and will slow CI. Consider keeping the lint script for local usage but removing the CI lint step, or alternatively making build include --noEmitOnError and relying on the build step for type-checking.
| - run: npm run lint |
npm run build already runs tsc (with emit), which fails on type errors same as tsc --noEmit. Keeping npm run lint in package.json for fast local type-checking without emitting build artifacts. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| ## Agent workflow | ||
| - Always work on a branch. Never push directly to main. | ||
| - Create PRs targeting main. CI must pass (lint + build + test on Node 20 and 22). |
There was a problem hiding this comment.
CLAUDE.md states CI must pass “lint + build + test”, but the current CI workflow (.github/workflows/ci.yml) only runs npm run build and npm test (no lint step). Either update the workflow to run npm run lint (as described in the PR summary) or adjust this documentation line to match reality.
After dropping the redundant lint step from CI, CLAUDE.md still claimed CI ran "lint + build + test". Correct it to "build + test" and call out that local lint remains available as a faster type-check during development. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| }, | ||
| "scripts": { | ||
| "build": "tsc", | ||
| "lint": "tsc --noEmit", |
There was a problem hiding this comment.
PR description says a CI step was added for type-checking/lint, but the current GitHub Actions workflow only runs npm run build and npm test and does not call npm run lint. Either update the workflow to run the new lint script (or replace the build step if appropriate), or adjust the PR description/docs to match actual CI behavior.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "build": "tsc", | ||
| "lint": "tsc --noEmit", | ||
| "test": "vitest run", |
There was a problem hiding this comment.
PR title mentions adding lint to CI, but this change only adds a local lint script; the CI workflow still runs npm run build and npm test without a lint step. Consider updating the PR title/description to match the actual change, or add npm run lint to CI if that’s the intent.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
lintscript (tsc --noEmit) for fast local type-checking (CI'sbuildstep already runstscwith emit, so no separate lint step is needed in CI)Part of autonomous repo setup.
Test plan
npm run lintsucceeds locally