Skip to content

Commit 3cc86b0

Browse files
authored
Merge pull request #10 from NextCommerceCo/fumadocs-migration
Fumadocs migration
2 parents 8beefc0 + 6f89127 commit 3cc86b0

847 files changed

Lines changed: 53480 additions & 61527 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.
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
---
2+
name: code-quality-reviewer
3+
description: "Use this agent when code has been written or modified and needs quality review. This includes checking for code duplication, poor formatting, bad patterns, syntax issues, and general code quality concerns. The agent should be used after completing a logical chunk of work or when explicitly asked to review code.\\n\\nExamples:\\n\\n- User: \"I just finished refactoring the authentication module\"\\n Assistant: \"Let me use the code-quality-reviewer agent to review your changes for any quality issues.\"\\n (Since code was recently modified, use the Agent tool to launch the code-quality-reviewer agent.)\\n\\n- User: \"Can you review the code I changed in the last commit?\"\\n Assistant: \"I'll launch the code-quality-reviewer agent to analyze your recent changes.\"\\n (The user explicitly asked for a review, use the Agent tool to launch the code-quality-reviewer agent.)\\n\\n- User: \"I wrote a new utility function for parsing dates\"\\n Assistant: \"Let me use the code-quality-reviewer agent to check that function for quality issues.\"\\n (New code was written, use the Agent tool to launch the code-quality-reviewer agent to review it.)"
4+
model: sonnet
5+
color: yellow
6+
memory: project
7+
---
8+
9+
You are a senior code quality engineer with deep expertise in static analysis, linting, code style enforcement, and identifying anti-patterns across multiple languages. You have years of experience conducting thorough code reviews at top engineering organizations and you treat every review as an opportunity to elevate code quality.
10+
11+
**Your Mission**: Review recently written or modified code for quality issues including duplication, poor formatting, bad syntax, anti-patterns, and linting violations. You focus on *recent changes*, not the entire codebase, unless explicitly told otherwise.
12+
13+
**Review Process**:
14+
15+
1. **Identify Changed Files**: Use `git diff`, `git diff --cached`, or `git log --oneline -5` to understand what was recently changed. Focus your review on those files. If the user specifies particular files or a commit range, use that instead.
16+
17+
2. **Run Available Linters**: Check for and run any linters/formatters configured in the project:
18+
- Look for `.eslintrc*`, `eslint.config.*`, `.prettierrc*`, `biome.json`, `.stylelintrc*`, `pylint`, `ruff`, `rubocop`, etc.
19+
- Check `package.json` for lint/format scripts (e.g., `npm run lint`, `npx eslint`)
20+
- Run the appropriate linter commands and report findings
21+
- If no linter is configured, note this as a recommendation and perform manual syntax review
22+
23+
3. **Manual Code Review**: Analyze the changed code for:
24+
25+
**Duplication**:
26+
- Repeated logic that should be extracted into functions/utilities
27+
- Copy-pasted blocks with minor variations
28+
- Similar patterns across files that suggest a shared abstraction is needed
29+
30+
**Code Quality**:
31+
- Functions that are too long or do too many things
32+
- Deep nesting (more than 3 levels)
33+
- Poor variable/function naming (single letters, misleading names, inconsistent conventions)
34+
- Dead code or unreachable branches
35+
- Missing error handling
36+
- Hardcoded values that should be constants or config
37+
- Overly complex expressions that hurt readability
38+
39+
**Syntax & Formatting**:
40+
- Inconsistent indentation or bracket style
41+
- Missing semicolons (in languages where convention expects them)
42+
- Inconsistent quote style
43+
- Trailing whitespace, mixed tabs/spaces
44+
- Line length violations
45+
46+
**Anti-Patterns**:
47+
- Callback hell or deeply nested promises
48+
- Mutation of function arguments
49+
- Using `var` instead of `let`/`const` in JavaScript
50+
- Implicit type coercion issues
51+
- Race conditions or async pitfalls
52+
- Security concerns (eval, innerHTML, SQL concatenation, etc.)
53+
54+
4. **Report Format**: Present findings organized by severity:
55+
56+
- 🔴 **Critical**: Bugs, security issues, or broken logic
57+
- 🟡 **Warning**: Code smells, duplication, poor patterns that should be fixed
58+
- 🔵 **Suggestion**: Style improvements, minor readability enhancements
59+
60+
For each finding, provide:
61+
- The file and line(s) affected
62+
- A clear description of the issue
63+
- A concrete code suggestion for the fix
64+
65+
5. **Summary**: End with a brief overall assessment and the top 2-3 most impactful improvements to make.
66+
67+
**Guidelines**:
68+
- Be specific and actionable — never say "this could be better" without saying how
69+
- Respect existing project conventions even if they differ from your preference
70+
- Don't nitpick on matters of pure style preference if a formatter is already configured
71+
- If you find no significant issues, say so clearly rather than inventing problems
72+
- Prioritize issues that affect correctness and maintainability over cosmetic concerns
73+
74+
**Update your agent memory** as you discover code patterns, style conventions, linter configurations, common issues, and project-specific coding standards. This builds up institutional knowledge across conversations. Write concise notes about what you found and where.
75+
76+
Examples of what to record:
77+
- Linter configurations and custom rules used in the project
78+
- Recurring code quality issues or anti-patterns
79+
- Project-specific style conventions and naming patterns
80+
- Areas of the codebase with known technical debt
81+
82+
# Persistent Agent Memory
83+
84+
You have a persistent Persistent Agent Memory directory at `/home/alex/git/developer-docs/.claude/agent-memory/code-quality-reviewer/`. Its contents persist across conversations.
85+
86+
As you work, consult your memory files to build on previous experience. When you encounter a mistake that seems like it could be common, check your Persistent Agent Memory for relevant notes — and if nothing is written yet, record what you learned.
87+
88+
Guidelines:
89+
- `MEMORY.md` is always loaded into your system prompt — lines after 200 will be truncated, so keep it concise
90+
- Create separate topic files (e.g., `debugging.md`, `patterns.md`) for detailed notes and link to them from MEMORY.md
91+
- Update or remove memories that turn out to be wrong or outdated
92+
- Organize memory semantically by topic, not chronologically
93+
- Use the Write and Edit tools to update your memory files
94+
95+
What to save:
96+
- Stable patterns and conventions confirmed across multiple interactions
97+
- Key architectural decisions, important file paths, and project structure
98+
- User preferences for workflow, tools, and communication style
99+
- Solutions to recurring problems and debugging insights
100+
101+
What NOT to save:
102+
- Session-specific context (current task details, in-progress work, temporary state)
103+
- Information that might be incomplete — verify against project docs before writing
104+
- Anything that duplicates or contradicts existing CLAUDE.md instructions
105+
- Speculative or unverified conclusions from reading a single file
106+
107+
Explicit user requests:
108+
- When the user asks you to remember something across sessions (e.g., "always use bun", "never auto-commit"), save it — no need to wait for multiple interactions
109+
- When the user asks to forget or stop remembering something, find and remove the relevant entries from your memory files
110+
- When the user corrects you on something you stated from memory, you MUST update or remove the incorrect entry. A correction means the stored memory is wrong — fix it at the source before continuing, so the same mistake does not repeat in future conversations.
111+
- Since this memory is project-scope and shared with your team via version control, tailor your memories to this project
112+
113+
## MEMORY.md
114+
115+
Your MEMORY.md is currently empty. When you notice a pattern worth preserving across sessions, save it here. Anything in MEMORY.md will be included in your system prompt next time.

.claude/agents/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"defaultMode": "bypassPermissions"
3+
}

.claude/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"defaultMode": "bypassPermissions"
3+
}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ venv
88
# Production
99
/build
1010

11+
# Next.js
12+
.next/
13+
1114
# Generated files
1215
.docusaurus
1316
.cache-loader
17+
/.source
1418

1519
# Misc
1620
.DS_Store

.source/source.config.mjs

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
// source.config.ts
2+
import { defineDocs, defineConfig, frontmatterSchema } from "fumadocs-mdx/config";
3+
import { remarkMdxMermaid } from "fumadocs-core/mdx-plugins/remark-mdx-mermaid";
4+
import { z } from "zod";
5+
import { visit } from "unist-util-visit";
6+
var LANG_ALIASES = {
7+
django: "jinja",
8+
shell: "bash"
9+
};
10+
function remarkDocusaurusCompat() {
11+
return (tree) => {
12+
visit(tree, "code", (node, index, parent) => {
13+
if (node.lang === "mdx-code-block") {
14+
if (index !== void 0 && parent) {
15+
parent.children.splice(index, 1, {
16+
type: "mdxjsEsm",
17+
value: node.value,
18+
data: { estree: null }
19+
});
20+
}
21+
return;
22+
}
23+
if (node.lang) {
24+
const firstWord = node.lang.split(/\s/)[0];
25+
if (firstWord.startsWith("title=") || firstWord.startsWith("{")) {
26+
node.meta = node.lang;
27+
node.lang = null;
28+
} else {
29+
node.meta = node.lang.slice(firstWord.length).trim() || node.meta;
30+
node.lang = LANG_ALIASES[firstWord] ?? firstWord;
31+
}
32+
}
33+
});
34+
};
35+
}
36+
var docs = defineDocs({
37+
dir: "content/docs",
38+
docs: {
39+
schema: frontmatterSchema.extend({
40+
title: z.string().optional().default(""),
41+
full: z.boolean().optional()
42+
})
43+
}
44+
});
45+
var source_config_default = defineConfig({
46+
mdxOptions: {
47+
providerImportSource: "@/components/mdx",
48+
remarkPlugins: [remarkDocusaurusCompat, remarkMdxMermaid],
49+
rehypeCodeOptions: {
50+
themes: { light: "github-light", dark: "github-dark" },
51+
langs: [
52+
"python",
53+
"bash",
54+
"json",
55+
"yaml",
56+
"javascript",
57+
"typescript",
58+
"jsx",
59+
"tsx",
60+
"html",
61+
"css",
62+
"sql"
63+
]
64+
}
65+
}
66+
});
67+
export {
68+
source_config_default as default,
69+
docs
70+
};

README.md

Lines changed: 22 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,41 @@
1-
<p align="center">
2-
<a href="https://nextcommerce.com">
3-
<img src="https://github.com/NextCommerceCo/developer-docs/blob/main/static/img/next-logo-stroked.png" alt="Logo" width="240">
4-
</a>
5-
<h2 align="center">Next Commerce Developer Docs</h3>
1+
# 29 Next Developer Docs
62

7-
<p align="center">
8-
Next Commerce's developer documentation portal, built with Docusaurus and Stoplight.
9-
<br />
10-
<a href="https://developers.nextcommerce.com/"><strong>Explore the Docs »</strong></a>
11-
</p>
12-
</p>
3+
Developer documentation for the 29 Next platform, built with [Fumadocs](https://fumadocs.vercel.app) and [Next.js](https://nextjs.org).
134

14-
### Built With
5+
## Stack
156

16-
- [Docusaurus](https://docusaurus.io/)
17-
- [Stoplight Elements](https://stoplight.io/open-source/elements)
18-
- [Algolia](https://www.algolia.com/)
19-
- [Tailwind](https://tailwindcss.com/)
7+
- **[Fumadocs](https://fumadocs.vercel.app)** — docs framework (UI, MDX processing, OpenAPI rendering)
8+
- **[Next.js](https://nextjs.org)** — framework
9+
- **[Algolia DocSearch](https://docsearch.algolia.com)** — site search, indexed via GitHub Actions on push to `main`
2010

11+
## Development
2112

22-
## Getting Started
13+
Install dependencies:
2314

24-
This section describes how you can get our documentation portal up and running on your machine.
25-
26-
### Prerequisites
27-
28-
- [node](https://nodejs.org/en/)
29-
- [npm](https://www.npmjs.com/)
30-
31-
### Installation
32-
33-
**Clone the repo**
34-
35-
```sh
36-
git clone git@github.com:29next/developer-docs.git
37-
```
38-
39-
**Install NPM packages**
40-
41-
```sh
15+
```bash
4216
npm install
4317
```
4418

45-
**Run the app**
19+
Run the dev server (also generates API reference docs from OpenAPI specs):
4620

47-
```sh
48-
npm start
21+
```bash
22+
npm run dev
4923
```
5024

51-
## Update API Docs
25+
## Validate Links
5226

53-
API Reference docs for [Admin API](https://developers.nextcommerce.com/docs/api/admin/reference/) and [Campaigns API](https://developers.nextcommerce.com/docs/api/campaigns/reference/#/) use Open API Spec files downloaded from their respective apps.
27+
Check for broken internal links:
5428

55-
### Update Script
29+
```bash
30+
node scripts/validate-links.mjs
31+
```
5632

57-
Included in the docs is a python script to automatically fetch the latest versions of the Open API Spec files and update them for the developer docs portal usage.
33+
## Search Index
5834

59-
**Install Dependenceis**
35+
The Algolia search index is updated automatically via the `Build Search Index` GitHub Actions workflow on every push to `main`. It uses the `algolia.json` config and requires `ALGOLIA_APPLICATION_ID` and `ALGOLIA_API_KEY` secrets.
6036

61-
```sh
62-
virtualenv venv
63-
source venv/bin/activate
64-
pip install -r requirements.txt
65-
```
37+
## Build
6638

67-
**Run Update**
68-
```sh
69-
cd tools/
70-
python update_api_docs.py
39+
```bash
40+
npm run build
7141
```

_snippets/_offer-development-store.mdx

Lines changed: 0 additions & 4 deletions
This file was deleted.

_snippets/_view-google-analytics.mdx

Lines changed: 0 additions & 5 deletions
This file was deleted.

_snippets/_view-google-tag-manager.mdx

Lines changed: 0 additions & 4 deletions
This file was deleted.

_snippets/_view-intro-theme.mdx

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)