Skip to content

Commit f8ddbb3

Browse files
authored
Merge pull request #14 from spivx/github-scan
feat: enhance wizard completion summary with file output options
2 parents 55bcacd + 96aacca commit f8ddbb3

27 files changed

+1515
-2535
lines changed

agents.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,97 @@
4040

4141

4242
- When you identify reusable effect logic, wrap it in a custom hook under `hooks/` (e.g., `use-window-click-dismiss.ts`) and consume that hook rather than repeating `useEffect` blocks.
43+
44+
45+
---
46+
47+
## Prompt for Codex Agent
48+
49+
You are the **DevContext Assistant**, helping developers generate AI-ready instruction files (`copilot-instructions.md`, `agents.md`, `cursor-rules.md`) for their projects.
50+
51+
Your role is to **analyze input (manual answers or GitHub repo scans)**, infer project conventions, and generate high-quality context/config files tailored to the project.
52+
53+
---
54+
55+
### Core Capabilities
56+
57+
1. **Modes of Use**
58+
- **New Project (Wizard)**
59+
- Ask the user step-by-step questions (IDE, framework, language, tooling, file structure, naming conventions, testing approach, etc.).
60+
- Allow skipping questions and using defaults to generate a boilerplate instructions file.
61+
- **Existing Project (GitHub Repo)**
62+
- Accept a GitHub repo URL or `owner/repo`.
63+
- Fetch metadata (via GitHub API or local scan): languages, frameworks, configs, testing tools, structure.
64+
- Pre-fill wizard answers based on detected information.
65+
- Ask only about missing/ambiguous details.
66+
- Provide smart suggestions (e.g., “Detected ESLint but no Prettier — do you want me to add Prettier rules?”).
67+
68+
2. **Repo Scanning Rules**
69+
- Detect frameworks/languages:
70+
- `package.json` → React, Next.js, Angular, etc.
71+
- `requirements.txt`, `pyproject.toml` → Django, FastAPI, Flask, etc.
72+
- `pom.xml`, `build.gradle` → Java/Spring.
73+
- Detect tooling/config:
74+
- ESLint, Prettier, Babel, Webpack, Vite, Dockerfile, TSConfig.
75+
- Detect testing:
76+
- Jest, Vitest, Cypress, Playwright, Mocha.
77+
- Detect structure:
78+
- Presence of `src/`, `tests/`, `components/`, etc.
79+
- Summarize findings in a clear JSON object.
80+
81+
3. **Output**
82+
- Generate one or more instruction/config files depending on user choice:
83+
- `copilot-instructions.md`
84+
- `agents.md`
85+
- `cursor-rules.md`
86+
- File must include:
87+
- Environment (IDE, framework, language, tooling).
88+
- Project priorities.
89+
- Code style (naming, structure, comments, testing).
90+
- AI-related guidelines (how Copilot, Cursor, or agents should behave).
91+
- Provide options:
92+
- Preview file in UI.
93+
- Copy to clipboard.
94+
- Download file.
95+
96+
---
97+
98+
### UX Rules
99+
100+
- Always make it clear what value you bring:
101+
- For wizard: *“Guided setup for AI coding guidelines.”*
102+
- For repo scan: *“Auto-detect stack and generate context-aware instructions.”*
103+
- Use smart defaults, but let user override.
104+
- Keep the flow simple: *Landing → Choose (New or Existing Project) → Wizard (manual or prefilled) → Generate File.*
105+
- At the end, provide both the file output and short explanation: *“This file was generated based on your repo + your preferences.”*
106+
107+
---
108+
109+
### SEO / Positioning Notes
110+
111+
- Emphasize you are not just a “file generator” but a **repo-aware, AI coding guidelines assistant**.
112+
- Highlight keywords: *AI coding guidelines, Copilot instructions, Cursor rules, GitHub repo analyzer, IDE setup automation, developer onboarding docs.*
113+
114+
---
115+
116+
### Example Workflow (Existing Project)
117+
118+
1. User inputs repo URL → agent scans repo.
119+
2. Agent outputs summary JSON:
120+
```json
121+
{
122+
"language": "TypeScript",
123+
"frameworks": ["Next.js", "React"],
124+
"tooling": ["ESLint", "Tailwind"],
125+
"testing": [],
126+
"structure": { "src": true, "tests": true }
127+
}
128+
```
129+
3. Agent asks:
130+
*“We detected Next.js + React + ESLint. Do you want to add Prettier rules? Do you plan to add Jest or another testing framework?”*
131+
4. Agent generates `copilot-instructions.md` with these conventions baked in.
132+
5. User downloads or copies the file.
133+
134+
---
135+
136+
👉 Use this as your guiding instruction: **always detect what you can, ask only when needed, and generate a repo-aware instructions file that saves the user time.**

app/layout.tsx

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,15 @@ const geistSans = Geist({
1111
subsets: ["latin"],
1212
});
1313

14-
1514
const geistMono = Geist_Mono({
1615
variable: "--font-geist-mono",
1716
subsets: ["latin"],
1817
});
1918

20-
const siteUrl = "https://devcontext.com";
21-
const siteTitle = "DevContext – AI Coding Guidelines & Context Generator";
19+
const siteUrl = "https://devcontext.xyz";
20+
const siteTitle = "DevContext – AI Coding Guidelines & Repo Analyzer";
2221
const siteDescription =
23-
"DevContext helps developers generate AI config files like Copilot instructions, Cursor rules, and prompts — consistent, fast, IDE-ready.";
22+
"DevContext helps developers generate AI config files like Copilot instructions, Cursor rules, and agents.md. Start fresh with a guided wizard or analyze your GitHub repo to auto-detect stack, frameworks, and best practices — consistent, fast, and IDE-ready.";
2423

2524
const ogImage = `${siteUrl}/og-image.png`;
2625

@@ -46,14 +45,22 @@ const structuredData = {
4645
featureList: [
4746
"Guided wizard for AI coding instructions",
4847
"Prebuilt templates for Copilot, Cursor, and IDE agents",
49-
"Context-aware questions with best-practice examples",
48+
"Scan a GitHub repo to auto-detect stack, frameworks, and tooling",
49+
"Context-aware questions with best-practice suggestions",
50+
"Instant boilerplate generation with smart defaults",
5051
],
5152
keywords: [
53+
"AI coding guidelines",
54+
"Copilot instructions generator",
55+
"Cursor rules builder",
56+
"IDE setup automation",
57+
"Developer onboarding docs",
5258
"generate Copilot instructions file",
5359
"generate agents file",
54-
"generate AI instructions",
5560
"generate Cursor rules",
56-
"AI development workflows",
61+
"AI repo analyzer",
62+
"GitHub repo scanner for Copilot",
63+
"repo-aware coding guidelines",
5764
],
5865
};
5966

@@ -79,6 +86,10 @@ export const metadata: Metadata = {
7986
"Copilot instructions",
8087
"Cursor rules",
8188
"agents md",
89+
"GitHub repo analyzer",
90+
"generate coding standards from GitHub repo",
91+
"repo-aware AI coding guidelines",
92+
"auto-detect framework coding rules",
8293
],
8394
authors: [{ name: "DevContext" }],
8495
creator: "DevContext",
@@ -89,8 +100,7 @@ export const metadata: Metadata = {
89100
},
90101
openGraph: {
91102
title: siteTitle,
92-
description:
93-
"Generate AI config files like Copilot instructions, Cursor rules, and prompts. Consistent, fast, and IDE-ready.",
103+
description: siteDescription,
94104
url: siteUrl,
95105
siteName: "DevContext",
96106
images: [
@@ -107,8 +117,7 @@ export const metadata: Metadata = {
107117
twitter: {
108118
card: "summary_large_image",
109119
title: siteTitle,
110-
description:
111-
"Generate AI config files like Copilot instructions, Cursor rules, and prompts. Consistent, fast, and IDE-ready.",
120+
description: siteDescription,
112121
images: [ogImage],
113122
site: "@devcontext",
114123
},
@@ -141,20 +150,21 @@ export const metadata: Metadata = {
141150
},
142151
};
143152

144-
145-
146153
export default function RootLayout({
147154
children,
148155
}: Readonly<{
149156
children: React.ReactNode;
150157
}>) {
151-
152158
return (
153159
<html lang="en" suppressHydrationWarning className="dark">
154160
<body
155161
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
156162
>
157-
<Script id="structured-data" type="application/ld+json" strategy="beforeInteractive">
163+
<Script
164+
id="structured-data"
165+
type="application/ld+json"
166+
strategy="beforeInteractive"
167+
>
158168
{JSON.stringify(structuredData)}
159169
</Script>
160170
<ThemeProvider

app/new/page.tsx

Lines changed: 36 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -1,143 +1,39 @@
1-
"use client"
2-
3-
import { Suspense, useMemo, useState } from "react"
4-
5-
import { Button } from "@/components/ui/button"
6-
import { InstructionsWizard } from "@/components/instructions-wizard"
7-
import { AnimatedBackground } from "@/components/AnimatedBackground"
8-
import { getHomeMainClasses } from "@/lib/utils"
9-
import { ANALYTICS_EVENTS } from "@/lib/analytics-events"
10-
import { track } from "@/lib/mixpanel"
11-
import type { DataQuestionSource, FileOutputConfig } from "@/types/wizard"
12-
import { Github } from "lucide-react"
13-
import Link from "next/link"
14-
import { useSearchParams } from "next/navigation"
15-
16-
import filesData from "@/data/files.json"
17-
import { buildFileOptionsFromQuestion } from "@/lib/wizard-utils"
18-
19-
const fileQuestionSet = filesData as DataQuestionSource[]
20-
const fileQuestion = fileQuestionSet[0] ?? null
21-
const fileOptionsFromData = buildFileOptionsFromQuestion(fileQuestion)
22-
23-
export default function NewInstructionsPage() {
24-
return (
25-
<Suspense fallback={<LoadingFallback />}>
26-
<NewInstructionsPageContent />
27-
</Suspense>
28-
)
29-
}
30-
31-
function NewInstructionsPageContent() {
32-
const searchParams = useSearchParams()
33-
const [showWizard, setShowWizard] = useState(false)
34-
const [selectedFileId, setSelectedFileId] = useState<string | null>(null)
35-
36-
const fileOptions = useMemo(() => fileOptionsFromData, [])
37-
const preferredStackId = searchParams.get("stack")?.toLowerCase() ?? null
38-
39-
const handleFileCtaClick = (file: FileOutputConfig) => {
40-
setSelectedFileId(file.id)
41-
setShowWizard(true)
42-
track(ANALYTICS_EVENTS.CREATE_INSTRUCTIONS_FILE, {
43-
fileId: file.id,
44-
fileLabel: file.label,
45-
})
46-
}
47-
48-
const handleWizardClose = () => {
49-
setShowWizard(false)
50-
setSelectedFileId(null)
51-
}
52-
53-
return (
54-
<div className="relative min-h-screen overflow-hidden bg-background text-foreground">
55-
<AnimatedBackground />
56-
<div className="relative z-10 flex min-h-screen flex-col">
57-
{/* Top utility bar */}
58-
<div
59-
className={`absolute inset-x-0 top-4 flex items-center px-6 sm:px-8 lg:px-12 ${showWizard ? "justify-end" : "justify-between"}`}
60-
>
61-
{!showWizard ? (
62-
<>
63-
<Link href="/" className="text-lg font-semibold tracking-tight text-foreground md:text-xl">
64-
DevContext
65-
</Link>
66-
<Link href="https://github.com/spivx/devcontext" target="_blank">
67-
<Button variant="outline" size="sm">
68-
<Github className="mr-2 h-4 w-4" />
69-
GitHub
70-
</Button>
71-
</Link>
72-
</>
73-
) : (
74-
<Link href="https://github.com/spivx/devcontext" target="_blank">
75-
<Button variant="outline" size="sm">
76-
<Github className="mr-2 h-4 w-4" />
77-
GitHub
78-
</Button>
79-
</Link>
80-
)}
81-
</div>
82-
83-
{/* Hero Section */}
84-
<main className={getHomeMainClasses(showWizard)}>
85-
{showWizard && selectedFileId ? (
86-
<InstructionsWizard
87-
selectedFileId={selectedFileId}
88-
onClose={handleWizardClose}
89-
initialStackId={preferredStackId}
90-
/>
91-
) : (
92-
<>
93-
<div className="space-y-6">
94-
<div className="space-y-4">
95-
<h1 className="text-3xl font-bold">Start a new instructions project</h1>
96-
<p className="mx-auto max-w-2xl text-base leading-relaxed text-muted-foreground md:text-lg">
97-
Choose the file preset that matches what you need. The wizard will open with targeted questions and save progress as you go.
98-
</p>
99-
<div className="mx-auto max-w-2xl text-left text-sm text-muted-foreground/90 md:text-base">
100-
<ul className="list-disc space-y-2 pl-5">
101-
<li>Pick a preset to load stack, architecture, and workflow prompts.</li>
102-
<li>Answer or skip questions — you can revisit any step before exporting.</li>
103-
<li>Download the generated file once every section shows as complete.</li>
104-
</ul>
105-
</div>
106-
</div>
107-
108-
{/* File type CTAs */}
109-
<div className="pt-6">
110-
<div className="flex flex-wrap items-center justify-center gap-5">
111-
{fileOptions.map((file) => {
112-
return (
113-
<button
114-
key={file.id}
115-
type="button"
116-
className="group inline-flex h-32 w-32 items-center justify-center rounded-full border border-border/60 bg-gradient-to-br from-card/95 via-card/90 to-card/80 px-6 text-sm font-medium text-foreground text-center shadow-sm ring-offset-background transition-all duration-200 hover:-translate-y-0.5 hover:border-primary/30 hover:shadow-lg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/80"
117-
onClick={() => handleFileCtaClick(file)}
118-
aria-label={`Create ${file.label}`}
119-
>
120-
<span className="break-words text-sm font-semibold leading-tight text-foreground transition-colors duration-200 group-hover:text-primary/90">
121-
{file.filename ?? file.label}
122-
</span>
123-
</button>
124-
)
125-
})}
126-
</div>
127-
</div>
128-
</div>
129-
</>
130-
)}
131-
</main>
132-
</div>
133-
</div>
134-
)
1+
import type { Metadata } from "next"
2+
import { redirect } from "next/navigation"
3+
4+
const title = "Launch the DevContext Wizard"
5+
const description =
6+
"Start a guided flow to assemble AI-ready coding instruction files. Pick your stack, customize conventions, and export Copilot, Cursor, or agents guidelines in minutes."
7+
8+
export const metadata: Metadata = {
9+
title,
10+
description,
11+
alternates: {
12+
canonical: "/new",
13+
},
14+
openGraph: {
15+
title,
16+
description,
17+
url: "/new",
18+
type: "website",
19+
siteName: "DevContext",
20+
images: [
21+
{
22+
url: "/og-image.png",
23+
width: 1200,
24+
height: 630,
25+
alt: "DevContext wizard interface preview",
26+
},
27+
],
28+
},
29+
twitter: {
30+
card: "summary_large_image",
31+
title,
32+
description,
33+
images: ["/og-image.png"],
34+
},
13535
}
13636

137-
function LoadingFallback() {
138-
return (
139-
<div className="flex min-h-screen items-center justify-center bg-background text-sm text-muted-foreground">
140-
Loading wizard…
141-
</div>
142-
)
37+
export default function NewPage() {
38+
redirect(`/new/stack`)
14339
}

0 commit comments

Comments
 (0)