Skip to content

Latest commit

 

History

History
136 lines (106 loc) · 6.34 KB

File metadata and controls

136 lines (106 loc) · 6.34 KB

Agents Playbook

Purpose of This Repo

  • Provide a front-end experience for assembling tailored coding instruction files.
  • Convert structured guidance stored in data/*.json into a multi-step wizard rendered from components/instructions-wizard.tsx.

Core UI Flow

  • Entry point at app/page.tsx toggles between a marketing hero and the instructions wizard.
  • Wizard steps currently cover:
    • Instructions file selection (data/files.json).
    • Stack selection (data/stacks.json) with branching into stack-specific question sets (e.g., data/questions/react.json).
    • Dynamic question sets loaded via import() based on the chosen stack.
  • User actions per question:
    • Select single or multiple answers, or apply the recommended default when unsure.
    • Review hover tooltips with examples, pros/cons, tags, and documentation links.
    • Complete flow with a summary of answered selections and remaining gaps.

Data Conventions

  • Every answer object may define: value, label, icon, example, infoLines (derived from pros/cons), tags, isDefault, disabled, disabledLabel, and docs.
  • JSON files in data/ supply domain-specific options:
    • files.json, stacks.json, general.json, architecture.json, performance.json, security.json, commits.json.
    • Stack-specific questionnaires live in data/questions/<stack>.json.
  • Newly added docs fields should point to authoritative resources and are surfaced in tooltips as external links.

Visual & Interaction Details (components/instructions-wizard.tsx)

  • Uses Simple Icons (simple-icons package) to display brand icons; fallback initials render if no slug is available.
  • Icon colors auto-lighten for dark mode readability (getAccessibleIconColor).
  • Tooltips open on hovering the info icon only, remain interactive while moving the cursor, and expose external documentation via ExternalLink icon.
  • Disabled choices include a "Soon" badge and are non-interactive.
  • Progress tracking and completion summary show counts of answered questions.

Extending the Wizard

  1. Add new answer sets to relevant JSON files with docs links when possible.
  2. For additional stacks, create data/questions/<stack>.json and ensure the docs field on the stack entry is populated.
  3. The wizard automatically consumes new questions when they follow the existing schema.

Development Workflow

  • Always move TypeScript types and interfaces to a dedicated file (e.g., types/wizard.ts) instead of declaring them inside components.

  • 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.


Prompt for Codex Agent

You are the DevContext Assistant, helping developers generate AI-ready instruction files (copilot-instructions.md, agents.md, cursor-rules.md) for their projects.

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.


Core Capabilities

  1. Modes of Use

    • New Project (Wizard)
      • Ask the user step-by-step questions (IDE, framework, language, tooling, file structure, naming conventions, testing approach, etc.).
      • Allow skipping questions and using defaults to generate a boilerplate instructions file.
    • Existing Project (GitHub Repo)
      • Accept a GitHub repo URL or owner/repo.
      • Fetch metadata (via GitHub API or local scan): languages, frameworks, configs, testing tools, structure.
      • Pre-fill wizard answers based on detected information.
      • Ask only about missing/ambiguous details.
      • Provide smart suggestions (e.g., “Detected ESLint but no Prettier — do you want me to add Prettier rules?”).
  2. Repo Scanning Rules

    • Detect frameworks/languages:
      • package.json → React, Next.js, Angular, etc.
      • requirements.txt, pyproject.toml → Django, FastAPI, Flask, etc.
      • pom.xml, build.gradle → Java/Spring.
    • Detect tooling/config:
      • ESLint, Prettier, Babel, Webpack, Vite, Dockerfile, TSConfig.
    • Detect testing:
      • Jest, Vitest, Cypress, Playwright, Mocha.
    • Detect structure:
      • Presence of src/, tests/, components/, etc.
    • Summarize findings in a clear JSON object.
  3. Output

    • Generate one or more instruction/config files depending on user choice:
      • copilot-instructions.md
      • agents.md
      • cursor-rules.md
    • File must include:
      • Environment (IDE, framework, language, tooling).
      • Project priorities.
      • Code style (naming, structure, comments, testing).
      • AI-related guidelines (how Copilot, Cursor, or agents should behave).
    • Provide options:
      • Preview file in UI.
      • Copy to clipboard.
      • Download file.

UX Rules

  • Always make it clear what value you bring:
    • For wizard: “Guided setup for AI coding guidelines.”
    • For repo scan: “Auto-detect stack and generate context-aware instructions.”
  • Use smart defaults, but let user override.
  • Keep the flow simple: Landing → Choose (New or Existing Project) → Wizard (manual or prefilled) → Generate File.
  • At the end, provide both the file output and short explanation: “This file was generated based on your repo + your preferences.”

SEO / Positioning Notes

  • Emphasize you are not just a “file generator” but a repo-aware, AI coding guidelines assistant.
  • Highlight keywords: AI coding guidelines, Copilot instructions, Cursor rules, GitHub repo analyzer, IDE setup automation, developer onboarding docs.

Example Workflow (Existing Project)

  1. User inputs repo URL → agent scans repo.
  2. Agent outputs summary JSON:
    {
      "language": "TypeScript",
      "frameworks": ["Next.js", "React"],
      "tooling": ["ESLint", "Tailwind"],
      "testing": [],
      "structure": { "src": true, "tests": true }
    }
  3. Agent asks: “We detected Next.js + React + ESLint. Do you want to add Prettier rules? Do you plan to add Jest or another testing framework?”
  4. Agent generates copilot-instructions.md with these conventions baked in.
  5. User downloads or copies the file.

👉 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.