You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* docs: Update CLAUDE.md and SKILL.md with guidelines on scope discipline and public/internal repo separation
* docs: Add feature_spec.yml template for internal feature specifications
* docs: Update CLAUDE.md and SKILL.md with scope discipline guidelines; modify feature_spec.yml title and placeholder
* docs: Add guidelines for handling refactoring in CLAUDE.md and SKILL.md
Copy file name to clipboardExpand all lines: .claude/skills/feature-spec/SKILL.md
+39-46Lines changed: 39 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,8 @@ You might have access to these resources during planning (paths marked "if avail
58
58
Follow these when designing:
59
59
60
60
-**Simple > complex, ruthlessly minimal** — only what's explicitly in scope
61
+
-**Reuse before creating.** Search for existing helpers, patterns, and utilities that already handle similar cases. Extend what exists rather than adding new abstractions.
62
+
-**Smallest possible feature.** Design the minimal version that solves the problem. If you're adding new parameters, methods, or abstractions, ask: is there a simpler way using what's already there?
61
63
-**Zod** for input validation, **HelperTools enum** for tool names
62
64
- Integration tests go in `tests/integration/suite.ts`
63
65
- Changes may affect `apify-mcp-server-internal` — always assess impact
@@ -75,65 +77,56 @@ During planning, explore:
75
77
5.**MCP Apps spec/SDK** if the feature involves widgets or interactive UIs — check both the spec and `node_modules/@modelcontextprotocol/ext-apps`
76
78
6. Use `mcp__apify-dev__*` and `mcp__apify-dev-ui__*` tools to test current behavior if the dev servers are running
77
79
78
-
Ask clarifying questions if the feature description is ambiguous. Prefer narrowing scope over guessing intent.
79
-
80
-
## Step 5: Produce the GitHub issue
81
-
82
-
When planning is complete, exit planning mode with `ExitPlanMode`, then create a GitHub issue using `gh issue create` with this structure:
80
+
**Public/internal repo separation**: See `CLAUDE.md § Public/internal repo separation`.
83
81
84
-
```markdown
85
-
## Context and motivation
86
-
[Why this feature is needed]
87
-
88
-
## Scope
82
+
Ask clarifying questions if the feature description is ambiguous. Prefer narrowing scope over guessing intent.
89
83
90
-
### In scope
91
-
-[bullet list]
84
+
## Step 5: Check existing issues
92
85
93
-
### Out of scope
94
-
-[bullet list]
86
+
Before creating anything, search for duplicates and related issues across all three repos:
95
87
96
-
## Technical design
88
+
```
89
+
gh issue list -R apify/apify-mcp-server --search "<feature keywords>" --json number,title,state
90
+
gh issue list -R apify/ai-team --search "<feature keywords>" --json number,title,state
91
+
gh issue list -R apify/apify-mcp-server-internal --search "<feature keywords>" --json number,title,state
92
+
```
97
93
98
-
### Overview
99
-
[High-level approach]
94
+
If a matching issue exists, update it with `gh issue edit` instead of creating a new one. Reference related issues from other repos in the description.
100
95
101
-
### Detailed design
102
-
[Implementation details, referencing existing code by file path]
96
+
## Step 6: Produce GitHub issues
103
97
104
-
### Files to modify
105
-
| File | Change |
106
-
|------|--------|
107
-
|`src/...`| Description |
98
+
When planning is complete, exit planning mode with `ExitPlanMode`, then create issues.
108
99
109
-
### New files (if any)
110
-
| File | Purpose |
111
-
|------|---------|
112
-
|`src/...`| Description |
100
+
**One issue per implementation phase.** A phase ≈ one PR-sized unit of work (roughly 50–200 lines changed). Example: phase 1 = add the new Zod schema + types, phase 2 = wire up the tool handler + tests. If the feature has multiple phases, create a separate issue for each. Each issue should be independently implementable.
113
101
114
-
## Internal repo impact
115
-
[Does apify-mcp-server-internal need changes? Check imports/usage.]
102
+
Use the repo's `feature_spec.yml` template (not `feature_request.yml` — that one is for external users). Write **concrete, concise, no empty sections** issues. Only include sections that have real content for this specific issue.
116
103
117
-
## Testing strategy
104
+
```markdown
105
+
## Problem
106
+
[Be concrete — numbers, error messages, user reports, Slack/issue links. "Users are confused" is weak; "3 users reported X in #channel" is strong.]
118
107
119
-
### Unit tests
120
-
-[Key test cases, target files]
108
+
##Proposed solution
109
+
[Short explanation of the approach. Reference existing code paths. If files need changing, list them here inline — don't make a separate table unless there are 5+ files.]
121
110
122
-
### Integration tests
123
-
-[Cases to add to tests/integration/suite.ts]
111
+
## Plan
112
+
-[ ] Step 1 (with PR links or assignees if known)
113
+
-[ ] Step 2
114
+
-[ ] ...
124
115
125
-
### Manual testing
126
-
-[Steps using local dev servers, MCPJam, or ChatGPT]
116
+
## Alternatives considered
117
+
[Only if you actually evaluated other approaches. Skip if there's one obvious solution.]
118
+
```
127
119
128
-
## Verification checklist
129
-
-[ ]`npm run type-check` passes
130
-
-[ ]`npm run lint` passes
131
-
-[ ]`npm run test:unit` passes
132
-
-[ ] Internal repo impact assessed
133
-
-[ ] No breaking changes (or coordinated)
120
+
**Style rules:**
121
+
- Skip any section that would be empty or generic
122
+
- Lead with real evidence (data, links, screenshots), not abstract motivation
123
+
- Keep it short — the best issues are 10-30 lines, not 100
124
+
- A checklist plan with concrete steps beats a wall of prose
134
125
135
-
## Open questions
136
-
-[Anything needing human decision]
137
-
```
126
+
**Before presenting the issues**, self-review the design:
127
+
- Is this the minimal design? Could the scope be smaller?
128
+
- Am I reusing existing patterns or reinventing?
129
+
- Could this be done by adjusting existing code rather than adding new code?
130
+
- Does the feature require refactoring first? If so, split into a separate refactoring PR that must merge before the feature work begins. Never mix refactoring with feature changes — the combined diff is hard to review and easy to break.
138
131
139
-
Present the issue content to the user for review before creating it. Use `gh issue create` with appropriate title and labels.
132
+
Present the issue content to the user for review before creating. Use `gh issue create` with appropriate title and`t-ai` labels.
Copy file name to clipboardExpand all lines: CLAUDE.md
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,15 @@ The server can run in multiple modes:
18
18
-**No over-engineering**: Solve the current problem, not hypothetical future ones
19
19
-**No unsolicited features**: Don't add anything not explicitly requested by the human operator
20
20
21
+
## Scope discipline
22
+
23
+
-**Bug fix = bug fix.** When fixing a bug, fix only the bug. Don't refactor surrounding code, don't improve naming, don't add comments, don't "clean up while you're here."
24
+
-**One thing per change.** Each change should do exactly one thing: fix a bug, add a feature, or refactor. Never combine. If you spot something unrelated that needs fixing, mention it — don't fix it.
25
+
-**Test first.** For bug fixes, write a failing test that reproduces the bug before touching source code. Run it to confirm it fails. Then fix.
26
+
-**Fix by adjusting, not adding.** Prefer a 1-line fix over a 10-line fix. Prefer adjusting existing code over adding new branches. Search for existing helpers and patterns that already handle similar cases. Ask: "Am I adding code, or fixing the code that's already there?"
27
+
-**Self-review your diff.** Before declaring done, review: Is this the minimal fix? Am I reusing existing patterns? Did I leave any debug artifacts?
28
+
-**Refactoring is a separate PR.** If a feature requires refactoring, do the refactoring first in its own PR, get it merged, then implement the feature. Never mix refactoring with feature work — the combined diff is hard to review and easy to break.
29
+
21
30
## ⚠️ MANDATORY: Verification after every implementation
**IMPORTANT**: This package (`@apify/actors-mcp-server`) is used in the private `apify-mcp-server-internal` repository for the hosted server. Changes here may affect that server. Breaking changes must be coordinated; check whether updates are needed in `apify-mcp-server-internal` before submitting a PR. See README.md for canary (`beta`) releases via `pkg.pr.new`.
102
111
112
+
### Public/internal repo separation (see [internal#419](https://github.com/apify/apify-mcp-server-internal/issues/419))
113
+
114
+
-**Public repo** = core MCP server logic, interfaces, types (with generic/plain data types only)
115
+
-**Internal repo** = backend/DB/proprietary logic (Redis, MongoDB, IAM auth, multi-node)
116
+
-**Never** import private Apify libraries or internal DB schemas into the public repo — external users can't install them
117
+
-**Expose methods on `ActorsMcpServer`**, not raw data exports via `./internals` — minimize the coupling surface
118
+
- When designing a new feature, ask: can this land in one repo? Prefer exposing a method or interface over exporting internals that the other repo re-implements
119
+
103
120
## Further reading
104
121
105
122
-**[CONTRIBUTING.md](./CONTRIBUTING.md)** — coding standards, patterns, anti-patterns, commit format, PR guidelines, design system rules
0 commit comments