Rewrites the README.md and adds inline JSDoc/docstrings to all public functions of a dead repository. Infers project purpose, installation steps, and usage examples from the codebase itself. Matches the tone of any existing documentation fragments.
Reconstruct meaningful documentation for a dead repository. Rewrite the README.md with all essential sections and add JSDoc comments to all public functions. Match the tone of any existing documentation fragments.
Before writing anything, gather all existing documentation signals:
# Check README word count and content
wc -w README.md 2>/dev/null
# Check for existing doc files
find . -name "*.md" -not -path "./node_modules/*" -not -path "./.git/*"
# Check for JSDoc comments
grep -rn "/\*\*" --include="*.js" --include="*.ts" \
--exclude-dir=node_modules --exclude-dir=dist . | head -20
# Check for .env.example
ls -la .env.example .env.sample env.example 2>/dev/null
# Check package.json for description and scripts
cat package.json | head -20
Read any existing documentation and classify its tone:
The new README.md must include ALL of these sections:
package.json description field + main entry point analysismain field in package.json) and summarize
what the top-level exports dogit log --reverse --oneline | head -5 # first commits reveal intent
Always include:
### Prerequisites
- Node.js [version from engines field or >=14]
- npm [version or >=6]
### Install
\`\`\`bash
npm install
\`\`\`
### Environment Variables
[Only if .env.example exists — list all variables with descriptions]
const lib = require('./package-name');
// Real usage based on actual exports
project-name/
├── src/ # Source code
│ ├── index.js # Entry point
│ └── utils/ # Utility functions
├── tests/ # Test files
├── package.json # Dependencies
└── README.md # This file
find . -not -path "./node_modules/*" -not -path "./.git/*" \
-not -path "./dist/*" | head -50
Standard fork/PR workflow:
1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
---
> 👻 **Revival Notice**: This repository was revived by
> [GitGhost](https://github.com/open-gitagent/gitagent) on [ISO date].
> Original repository: [link to original]
>
> *Every abandoned project deserves a second life.*
For every exported function that lacks JSDoc, generate documentation:
/**
* [Description inferred from function name and body]
*
* @param {type} paramName - [Description inferred from name and usage]
* @returns {type} [Description of return value]
* @example
* // [Real usage example from codebase or inferred]
* const result = functionName(exampleInput);
*
* @generated by GitGhost
*/
Rules:
@param, @returns, @example@throws, @async, @deprecated@generated by GitGhost as the last tagLook for common docs that should exist:
| File | Create if missing? | Content |
|---|---|---|
CHANGELOG.md | No | Too risky to fabricate history |
CONTRIBUTING.md | Yes | Standard contribution guide |
LICENSE | No | Cannot assume license intent |
CODE_OF_CONDUCT.md | Yes, if >5 contributors | Standard Contributor Covenant |
.env.example | Yes, if .env exists | Copy .env structure with placeholder values |
When rewriting README.md:
<!-- Original README content preserved below --> marker<details> section at the bottom:
<details>
<summary>Original README (preserved)</summary>
[original content here]
</details>