Keyboard Shortcuts N Next post
P Previous post
S Save / unsave
R Read aloud
T Toggle theme
/ Focus search
Esc Close panels
🔥
Ready to read...
beginner Documentation GitHub Copilot IMCSEIAN Project README Tutorial

Project 5 — Document an Existing Repo

Reviewed & accurate
AI Summary
IMCSEIAN · GitHub Copilot Master Course

Project 5 — Document an Existing Repo

Generate README, CONTRIBUTING, inline comments.

Phase 1 — Beginner Lesson BE-47 Difficulty: Beginner 15 min read
Course: GitHub Copilot Phase 1 — Beginner 15 min read Last verified: 2026-08-30

What You Will Learn

  • Generate a README.md with Copilot.
  • Add CONTRIBUTING.md.
  • Add inline docstrings.
  • Create an ARCHITECTURE.md.
  • Prepare a docs PR.

Why This Matters

Most repos have inadequate docs because writing docs is tedious. Copilot can draft them in minutes. A documented repo is easier to onboard to, easier to maintain, and easier to promote.

Concept Explained

Use Copilot to generate README.md, CONTRIBUTING.md, ARCHITECTURE.md, and inline docstrings for a repo with sparse documentation.

How It Works

Use @workspace to give Copilot repo-wide context. Ask for a README summarizing what the repo does. Generate CONTRIBUTING from your project's conventions. Add docstrings with /doc.

Step-by-Step Tutorial

1. Generate README

@workspace 'generate a README.md for this repo. Include: what it does, install, usage, examples, license.'

2. Generate CONTRIBUTING

'generate CONTRIBUTING.md based on this repo's conventions (branch naming, commit style, PR template).'

3. Generate ARCHITECTURE

'generate ARCHITECTURE.md explaining the repo's structure and data flow.'

4. Add docstrings

Run /doc on undocumented functions.

5. Prepare PR

Commit docs. Open a PR. Use Copilot for the PR description.

Real-World Example

A team inherited a 6-month-old internal tool with zero docs. They used Copilot to generate README, CONTRIBUTING, ARCHITECTURE, and 50 docstrings in 2 hours. Onboarding time for the next hire dropped from 3 days to 4 hours.

Example Prompts / Commands / Code

README promptimcseian
@workspace Generate a README.md for this repo.

Include sections:
- Title and one-line description
- Install (npm install, env vars needed)
- Usage (3 example commands)
- API reference (link to docs/)
- Contributing (link to CONTRIBUTING.md)
- License

Tone: professional but approachable. Use code blocks for commands.
ARCHITECTURE promptimcseian
@workspace Generate an ARCHITECTURE.md.

Explain:
1. The main modules and their responsibilities
2. How data flows through the system
3. Key design decisions
4. Where to add new features

Include an ASCII or Mermaid diagram showing module relationships.

Common Mistakes

  • Accepting README without verifying install instructions work.
  • Not running /doc on functions — only top-level docs.
  • Forgetting to commit and PR the docs.
  • Not linking to LICENSE file.

Best Practices

  • Use @workspace for repo-wide context.
  • Verify install instructions actually work.
  • Add docstrings with /doc, not just top-level docs.
  • Open a PR — don't leave docs uncommitted.
  • Link to LICENSE, CONTRIBUTING, ARCHITECTURE from README.

Troubleshooting

ProblemHow to Fix
README is genericBe specific: 'this is an internal tool for X, used by team Y'.
Architecture diagram is wrongUse @workspace and attach key files explicitly.

Practical Exercise

Your Turn

This IS the exercise. Pick a repo with sparse docs. Generate README, CONTRIBUTING, ARCHITECTURE. Add 5 docstrings. Open a docs PR.

Professional Challenge

Stretch Goal

After docs are merged, set up a GitHub Action that runs Copilot on every PR to suggest doc updates for changed code. (Covered in IN-48.)

Key Takeaways

  • Copilot drafts docs in minutes from repo context.
  • Use @workspace for repo-wide docs.
  • Always verify install instructions work.
  • Add inline docstrings with /doc.
  • Open a docs PR — don't leave uncommitted.

Frequently Asked Questions

Can Copilot generate API reference docs?
Yes — point it at OpenAPI specs or function signatures.
What about user guides?
Yes — describe the audience and ask for a guide.

Further Reading

Official References

Related lessons: BE-24, BE-28

SEO Metadata

SEO title: Project 5 — Document an Existing Repo

Meta description: Generate README, CONTRIBUTING, inline comments.

Primary keyword: project 5

Secondary keywords: project 5 — document an existing repo

Search intent: Informational

URL slug: /project-document-existing-repo-copilot

Categories: AI Tools, GitHub Copilot

Tags: GitHub Copilot, Beginner, Project, Documentation, README, IMCSEIAN, Tutorial, IMCSEIAN

Featured image concept: IMCSEIAN lesson card for Project 5 — Document an Existing Repo

Test Your Knowledge
How did you find this?

Comments

Join the discussion! Sign in with your Google or Blogger account, or comment as Anonymous - no account needed. For quick questions, also reach me on Telegram @cytestch.

Comments