Get the FREE Ultimate OpenClaw Setup Guide →

project-docs

Scanned
npx machina-cli add skill jjmartres/opencode/project-docs --openclaw
Files (1)
SKILL.md
5.1 KB

Project Documentation Generator

Generate complete, professional documentation structures for software projects. Automatically adapts content and structure based on project language (Python/Go), context (OpenSource/internal), and existing files.

Core Documentation Files

Always generate these five core files:

  1. README.md - Project overview, quick start, badges
  2. ARCHITECTURE.md - System design, components, data flow
  3. USER_GUIDE.md - Usage examples, configuration, troubleshooting
  4. DEVELOPER_GUIDE.md - Development setup, testing, contribution workflow
  5. CONTRIBUTING.md - Contribution guidelines, code standards, PR process

Workflow

1. Context Detection

Before generating docs, detect:

  • Language: Scan for go.mod, pyproject.toml, requirements.txt, setup.py
  • Project type: Check for Dockerfile, terraform/, k8s/, AI/ML indicators
  • Existing docs: Identify what already exists to avoid duplication
  • License: Detect from LICENSE file or ask user
  • Context: Determine if OpenSource or internal based on repo structure

2. Ask Clarifying Questions

Ask user ONE question at a time to fill gaps:

  • "What's the primary purpose of this project in one sentence?"
  • "Who's the main audience? (developers, ops, end-users, all)"
  • "Is this OpenSource or internal? (affects badges, contact info)"
  • "Any company-specific tooling to mention? (Jira, Slack channels, etc.)"

3. Content Adaptation

Read references/templates.md to select appropriate template variants based on detected context.

Language-specific elements:

  • Python: Package managers (uv, pip, poetry), testing (pytest), linting (ruff, mypy)
  • Go: Build commands, testing, golangci-lint, module structure

Context-specific elements:

  • OpenSource: Badges, CODE_OF_CONDUCT, security policy, community guidelines
  • Internal: Slack channels, internal tools, compliance requirements, team contacts

Project type adjustments:

  • AI Agents: MCP architecture, prompt patterns, example interactions
  • Infrastructure: Terraform/K8s setup, deployment procedures, DR plans
  • Microservices: API schemas, service mesh, health checks
  • CLI Tools: Installation methods, command examples, flags

4. File Generation

Generate files in this order:

  1. README.md first (most visible, sets tone)
  2. ARCHITECTURE.md (technical foundation)
  3. DEVELOPER_GUIDE.md (setup and contribution)
  4. USER_GUIDE.md (end-user focused)
  5. CONTRIBUTING.md (community guidelines)

Each file must:

  • Use clear headers and structure from templates
  • Include concrete, runnable examples
  • Reference other docs when needed (avoid duplication)
  • Match project's actual structure and commands

5. Template Application

For each file:

  1. Select template variant from references/templates.md
  2. Fill in project-specific details
  3. Add context-appropriate sections
  4. Ensure consistency across all files

6. Quality Checks

Before finalizing, verify:

  • All code examples are runnable and accurate
  • Commands match detected language/tooling
  • Cross-references between docs are correct
  • No placeholder text remains
  • Tone is consistent (technical/friendly/formal based on context)

7. Output

Place all files in docs/ and use present_files to share with user.

Resources

references/templates.md

Contains complete documentation templates for all five core files with variants for:

  • Python vs Go projects
  • OpenSource vs internal contexts
  • Different project types (agent, service, CLI, infra)
  • Different complexity levels

Claude should read this file to select appropriate templates before generating docs.

Special Considerations

For AI Agent projects:

  • Explain MCP server architecture
  • Document tool integrations
  • Show example prompts and interactions
  • Include LLM configuration details

For Infrastructure/DevOps:

  • Environment requirements (cloud providers, versions)
  • Deployment runbooks
  • Monitoring setup
  • Disaster recovery procedures

For Microservices:

  • API endpoint documentation
  • Service dependency diagrams
  • Inter-service communication patterns
  • Health check and metrics endpoints

Quality Standards

Every documentation file must:

  • Have table of contents for files >200 lines
  • Use proper code fences with language tags
  • Include "Quick Start" section at top
  • Show real, tested examples
  • Explain "why" decisions were made
  • Use consistent terminology throughout

Avoid

  • Generic placeholder text like "TODO" or "Coming soon"
  • Outdated technology references
  • Overly complex explanations without examples
  • Duplicating content across multiple files
  • Missing concrete code examples

Source

git clone https://github.com/jjmartres/opencode/blob/main/opencode/skill/project-docs/SKILL.mdView on GitHub

Overview

Generates five core docs for software projects: README.md, ARCHITECTURE.md, USER_GUIDE.md, DEVELOPER_GUIDE.md, and CONTRIBUTING.md. It adapts to Python/Go projects and OpenSource/internal contexts, choosing templates and content based on language, project type, and existing files. The result is a cohesive documentation suite placed under docs/ with cross-references and runnable examples.

How This Skill Works

The tool detects language (via go.mod, pyproject.toml, requirements.txt, setup.py), project type (Dockerfile, Terraform/k8s, etc.), and existing docs to avoid duplication. It then asks clarifying questions one at a time to fill gaps. Next, it applies templates from references/templates.md tailored to context, populates project-specific details, and generates the docs in a defined order under docs/. Finally, it performs quality checks to ensure runnable code blocks, accurate commands, and consistent tone.

When to Use It

  • You need a full documentation package for a new or legacy repo, including README, architecture, guides, and contribution guidelines.
  • You want the docs to adapt to Python or Go projects and reflect the correct tooling and commands.
  • You’re documenting an OpenSource project and want badges, CODE_OF_CONDUCT, and community guidelines.
  • You’re documenting an internal project and require internal-context details like Slack channels and compliance notes.
  • You’re bootstrapping docs for a new repository and want a ready-to-fill docs/ scaffold with templates.

Quick Start

  1. Step 1: Run the Project Documentation Generator on your repository.
  2. Step 2: Answer the one-question-at-a-time clarifying questions to fill gaps.
  3. Step 3: Review the generated docs under docs/ and adjust as needed, then share with the team using present_files.

Best Practices

  • Scan for language and project-type indicators early (e.g., go.mod, pyproject.toml, Dockerfile) to pick the right templates.
  • Fill concrete, runnable examples in each file and align commands with detected tooling.
  • Cross-reference docs to minimize duplication and keep a single source of truth.
  • Match the tone and structure to the context (OpenSource vs internal) and add appropriate badges.
  • Run the included quality checks before finalizing and place outputs in docs/ via present_files.

Example Use Cases

  • Open-source Python library repo wanting a complete docs package.
  • Go microservice with Docker/K8s deployment needing architecture and contributor guides.
  • Internal CLI tool requiring Slack channel links and compliance notes.
  • AI agent framework with MCP architecture and example prompt interactions.
  • Terraform-based infrastructure project with deployment procedures.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers