Skip to content

Commit bb987d7

Browse files
authored
Merge pull request #227 from ken-guru/refactor/nextjs-project-structure
Next.js Project Structure Refactoring
2 parents 0719208 + cb641c5 commit bb987d7

105 files changed

Lines changed: 1158 additions & 3397 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/copilot-instructions.md

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ This document contains guidelines for GitHub Copilot to follow when assisting wi
88
- Maintain thorough documentation with each code change
99
- Update the Memory Log for all debugging and issue resolution
1010
- Verify code quality through testing, linting, and type checking
11+
- **NEVER push code that fails CI/CD pipeline tests**
12+
- **Ensure all code passes npm run test, npm run lint, npm run type-check, and npm run build before commits**
1113
- Communicate clearly about implementation choices and alternatives
1214

1315
## TESTING PROTOCOLS [PRIORITY: HIGHEST]
@@ -36,8 +38,15 @@ This document contains guidelines for GitHub Copilot to follow when assisting wi
3638
### Test Verification
3739
- Remind to run test suite after ANY code changes
3840
- ALWAYS use terminal command: `npm run test`
41+
- For specific test patterns use: `npm test -- --testPathPatterns="pattern"`
3942
- Run tests in terminal, not through other interfaces
4043

44+
### GitHub PR Check Monitoring
45+
- Use `gh pr checks <PR_NUMBER> --fail-fast --watch` for real-time updates
46+
- Avoid using `gh pr checks` without flags as it may hang indefinitely
47+
- The `--fail-fast` flag ensures quick response when checks fail
48+
- The `--watch` flag provides live updates as checks complete
49+
4150
## DOCUMENTATION STANDARDS [PRIORITY: HIGH]
4251
### Component Documentation
4352
- CREATE/UPDATE in `docs/components/` when:
@@ -93,6 +102,13 @@ This document contains guidelines for GitHub Copilot to follow when assisting wi
93102
- MOVE to `docs/IMPLEMENTED_CHANGES.md` with timestamp when complete
94103
- ENSURE template format for effective AI-assisted implementation
95104

105+
### Planning Document Lifecycle Management
106+
- **CLEAR** `docs/PLANNED_CHANGES.md` after completing major features/PRs
107+
- **RESET** to template reference only to prepare for future work
108+
- **DOCUMENT** completed changes in `docs/IMPLEMENTED_CHANGES.md` before clearing
109+
- **COMMIT** the cleanup as part of PR completion process
110+
- **MAINTAIN** clean slate for next development cycle
111+
96112
### Template Usage for AI Agents
97113
- ALWAYS use `docs/templates/PLANNED_CHANGES_TEMPLATE.md` when user requests new features
98114
- COPY the complete template structure - never create partial specifications
@@ -198,6 +214,117 @@ This document contains guidelines for GitHub Copilot to follow when assisting wi
198214
- CHECK for duplicate files in scripts directory
199215
- RUN `node scripts/check-markdown-links.js` for link validation
200216

217+
## MCP TOOL USAGE GUIDELINES [PRIORITY: HIGH]
218+
### Enhanced Problem-Solving Tools
219+
When these MCP tools are available, leverage them to enhance development workflows and problem-solving capabilities:
220+
221+
#### Sequential Thinking Tool
222+
**Purpose**: Dynamic, step-by-step problem analysis and solution development
223+
**When to Use**:
224+
- Breaking down complex implementation requirements
225+
- Planning multi-step refactoring or migration processes
226+
- Analyzing debugging challenges that require systematic investigation
227+
- Design decisions that need thorough evaluation of alternatives
228+
- Problems where the full scope isn't initially clear
229+
- Tasks requiring context maintenance across multiple development steps
230+
231+
**Usage Guidelines**:
232+
- START with initial thought estimate but adjust `totalThoughts` as understanding deepens
233+
- USE `isRevision` and `revisesThought` to refine previous analysis
234+
- EMPLOY `branchFromThought` and `branchId` for exploring alternative approaches
235+
- SET `nextThoughtNeeded` to false only when satisfied with solution completeness
236+
- INCLUDE hypothesis generation and verification in the thinking process
237+
- DOCUMENT key insights in Memory Log after complex problem-solving sessions
238+
239+
**Example Applications**:
240+
- Component migration planning with dependency analysis
241+
- Test strategy development for complex features
242+
- Architecture decisions requiring trade-off evaluation
243+
- Debugging multi-layered issues with unknown root causes
244+
245+
#### Time Management Tool
246+
**Purpose**: Timezone-aware time handling and conversion
247+
**When to Use**:
248+
- Documenting timestamps in Memory Log entries with timezone context
249+
- Planning development schedules across team timezones
250+
- Handling time-sensitive features or deployments
251+
- Converting meeting times or deadlines for global collaboration
252+
- Adding temporal context to development milestones
253+
254+
**Usage Guidelines**:
255+
- USE `get_current_time` with specific IANA timezone names for accurate timestamps
256+
- APPLY `convert_time` when coordinating across multiple timezones
257+
- INCLUDE timezone information in all time-sensitive documentation
258+
- STANDARDIZE on UTC for internal logging, convert for user-facing times
259+
260+
**Example Applications**:
261+
- Memory Log entry timestamps: "Debugging session started at 2024-01-15 14:30:00 EST"
262+
- Release planning: "Deploy window: 02:00 UTC (21:00 EST, 15:00 JST+1)"
263+
- Meeting coordination: "Code review at 16:00 CET converts to 10:00 EST"
264+
265+
#### Memory Knowledge Graph Tool
266+
**Purpose**: Persistent knowledge management across development sessions
267+
**When to Use**:
268+
- Tracking complex project relationships and dependencies
269+
- Maintaining developer context across long-term initiatives
270+
- Building institutional knowledge about codebase patterns
271+
- Documenting architectural decisions and their relationships
272+
- Creating searchable knowledge base of debugging solutions
273+
274+
**Usage Guidelines**:
275+
**Entity Creation**:
276+
- CREATE entities for: components, developers, issues, features, dependencies, patterns
277+
- USE descriptive `entityType` classifications: "component", "developer", "issue", "pattern", "dependency"
278+
- STORE atomic observations: one fact per observation entry
279+
- MAINTAIN consistent naming conventions for entity references
280+
281+
**Relationship Mapping**:
282+
- DEFINE relations in active voice: "depends_on", "implements", "resolves", "authored_by"
283+
- MAP component dependencies, developer responsibilities, issue relationships
284+
- TRACK architectural patterns and their usage across codebase
285+
- DOCUMENT decision influences and implementation relationships
286+
287+
**Knowledge Retrieval**:
288+
- USE `search_nodes` for finding related information during development
289+
- APPLY `open_nodes` to retrieve specific context for current work
290+
- LEVERAGE `read_graph` for comprehensive project understanding
291+
- QUERY before starting complex tasks to gather relevant historical context
292+
293+
**Maintenance Practices**:
294+
- UPDATE observations when component behavior or architecture changes
295+
- ADD new relationships when dependencies or responsibilities shift
296+
- DELETE obsolete entities when components are removed or refactored
297+
- REGULAR cleanup of outdated observations and relationships
298+
299+
**Integration with Memory Log**:
300+
- LINK Memory Log entries to relevant knowledge graph entities
301+
- CREATE entities for significant debugging sessions and their outcomes
302+
- REFERENCE knowledge graph findings in Memory Log documentation
303+
- MAINTAIN bidirectional references between systems
304+
305+
### Tool Combination Strategies
306+
**Sequential Thinking + Memory Graph**:
307+
- USE sequential thinking to analyze complex problems
308+
- STORE analysis outcomes and decision rationale in knowledge graph
309+
- REFERENCE previous similar analyses when facing comparable challenges
310+
311+
**Time + Memory Graph**:
312+
- TIMESTAMP all knowledge graph updates with timezone context
313+
- TRACK temporal patterns in development issues and solutions
314+
- MAINTAIN historical timeline of architectural decisions
315+
316+
**All Three Tools Together**:
317+
- ANALYZE problems systematically with sequential thinking
318+
- DOCUMENT solutions and context in knowledge graph with time stamps
319+
- BUILD comprehensive development intelligence over time
320+
- CREATE searchable institutional memory for future reference
321+
322+
### Tool Availability Protocol
323+
- CHECK for tool availability before complex problem-solving sessions
324+
- INFORM users when enhanced capabilities are available
325+
- FALLBACK to standard approaches when tools unavailable
326+
- DOCUMENT enhanced workflows in Memory Log for process improvement
327+
201328
## COMMIT GUIDELINES [PRIORITY: HIGH]
202329
### Frequent Commit Strategy
203330
- COMMIT early and often to maintain development momentum

.github/workflows/main.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/checkout@v4
1414
- uses: actions/setup-node@v4
1515
with:
16-
node-version: '18'
16+
node-version: '20'
1717

1818
- name: Install dependencies
1919
run: npm ci
@@ -27,7 +27,7 @@ jobs:
2727
- uses: actions/checkout@v4
2828
- uses: actions/setup-node@v4
2929
with:
30-
node-version: '18'
30+
node-version: '20'
3131

3232
- name: Install dependencies
3333
run: npm ci
@@ -41,7 +41,7 @@ jobs:
4141
- uses: actions/checkout@v4
4242
- uses: actions/setup-node@v4
4343
with:
44-
node-version: '18'
44+
node-version: '20'
4545

4646
- name: Install dependencies
4747
run: npm ci
@@ -55,7 +55,7 @@ jobs:
5555
- uses: actions/checkout@v4
5656
- uses: actions/setup-node@v4
5757
with:
58-
node-version: '18'
58+
node-version: '20'
5959

6060
- name: Install dependencies
6161
run: npm ci
@@ -84,7 +84,7 @@ jobs:
8484
- uses: actions/checkout@v4
8585
- uses: actions/setup-node@v4
8686
with:
87-
node-version: '18'
87+
node-version: '20'
8888

8989
- name: Install dependencies
9090
run: npm ci
@@ -101,6 +101,21 @@ jobs:
101101
- name: Build application for testing
102102
run: npm run build
103103

104+
- name: Test production start (debugging)
105+
run: |
106+
echo "Testing if production server starts correctly..."
107+
timeout 30s npm start &
108+
SERVER_PID=$!
109+
sleep 10
110+
if curl -f http://localhost:3000 > /dev/null 2>&1; then
111+
echo "✅ Server is responding correctly"
112+
kill $SERVER_PID || true
113+
else
114+
echo "❌ Server failed to respond"
115+
kill $SERVER_PID || true
116+
exit 1
117+
fi
118+
104119
- name: Save Next.js cache
105120
uses: actions/cache/save@v4
106121
with:

.vscode/mcp.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,30 @@
2121
"env": {
2222
"GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}"
2323
}
24+
},
25+
"time": {
26+
"command": "docker",
27+
"args": ["run", "-i", "--rm", "mcp/time"]
28+
},
29+
"sequential-thinking": {
30+
"command": "docker",
31+
"args": [
32+
"run",
33+
"--rm",
34+
"-i",
35+
"mcp/sequentialthinking"
36+
]
37+
},
38+
"memory": {
39+
"command": "docker",
40+
"args": [
41+
"run",
42+
"-i",
43+
"-v",
44+
"claude-memory:/app/dist",
45+
"--rm",
46+
"mcp/memory"
47+
]
2448
}
2549
}
2650
}

0 commit comments

Comments
 (0)