diff --git a/plugins/docs/.claude-plugin/plugin.json b/plugins/docs/.claude-plugin/plugin.json index 30c7715..424d579 100644 --- a/plugins/docs/.claude-plugin/plugin.json +++ b/plugins/docs/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "docs", - "version": "1.1.1", + "version": "1.2.0", "description": "Generate and keep documentation in sync with your codebase", "homepage": "https://github.com/Flopsstuff/flugins", "author": { diff --git a/plugins/docs/commands/sync-docs.md b/plugins/docs/commands/sync-docs.md index f99510d..f27fddd 100644 --- a/plugins/docs/commands/sync-docs.md +++ b/plugins/docs/commands/sync-docs.md @@ -6,21 +6,31 @@ disable-model-invocation: false # Sync Documentation with Recent Changes -Usage: `/docs:sync-docs [number_of_commits]` +Usage: `/docs:sync-docs [number]` or `/docs:sync-docs [number]commits` -Analyze recent {number_of_commits} and update documentation to match current codebase: +Analyze recent changes and update documentation to match current codebase: -1. Extract the {number_of_commits} from the command arguments: - - If a {number_of_commits} is provided, use that value (e.g., `/docs:sync-docs 10` → analyze 10 commits) - - If no {number_of_commits} is provided, use 5 as default (e.g., `/docs:sync-docs` → analyze 5 commits) +1. Parse the argument from `$ARGUMENTS`: + - If no argument is provided → default to **1 day** (look back 1 day) + - If the argument is a plain number (e.g., `/docs:sync-docs 3`) → treat it as **days** (look back 3 days) + - If the argument ends with `commits` or `commit` (e.g., `/docs:sync-docs 10commits`) → treat it as a **commit count** (analyze 10 commits) + - Examples: + - `/docs:sync-docs` → 1 day + - `/docs:sync-docs 7` → 7 days + - `/docs:sync-docs 10commits` → 10 commits + - `/docs:sync-docs 1commit` → 1 commit -2. Analyze recent commits to understand changes: - - Use `git log -N -p` to get full commit history with diffs (where N is the number of commits) - - Review commit messages and full diff to understand the context of changes - - Use `git log -N --name-only` to list all files changed in these commits +2. Build the git log command based on the parsed argument: + - **Days mode**: `git log --since="N days ago" -p` to get all commits in the time window + - **Commits mode**: `git log -N -p` to get exactly N commits + +3. Analyze recent commits to understand changes: + - Run the appropriate `git log` command from step 2 + - Review commit messages and full diffs to understand the context of changes + - Use the `--name-only` variant of the same range to list all files changed - **IMPORTANT**: Read the CURRENT state of all changed files from the repository to understand the actual implementation -3. Read all modified files from recent commits: +4. Read all modified files from recent commits: - For each file changed in the analyzed commits, read its CURRENT content - Pay special attention to: - New files added (understand their purpose and functionality) @@ -28,12 +38,12 @@ Analyze recent {number_of_commits} and update documentation to match current cod - Deleted files (ensure they're not referenced in docs) - Analyze code to understand features, APIs, configuration, and architecture -4. Find and scan the documentation folder: +5. Find and scan the documentation folder: - Search for common documentation folder names in the project root: `docs/`, `doc/`, `documentation/` - Check for documentation indicators in README.md or project config files - Once the documentation folder is identified, scan it to identify all documentation files -5. Compare the documentation content with actual codebase state: +6. Compare the documentation content with actual codebase state: - Match documentation against CURRENT file contents (not just diffs) - Understand the full context of changes by reading actual code - Identify inconsistencies between docs and code: @@ -44,13 +54,13 @@ Analyze recent {number_of_commits} and update documentation to match current cod - Broken links to non-existent files - Configuration changes not reflected -6. Update all affected documentation files to match current state: +7. Update all affected documentation files to match current state: - Base updates on ACTUAL current file contents - Ensure code examples reflect real implementation - Update API signatures, parameters, and return values - Fix broken references and links -7. Maintain documentation structure: +8. Maintain documentation structure: - **Root index.md**: Ensure there's an `index.md` in the docs root folder - Contains links to ALL files and folders at that level - Each link has a short description of content @@ -64,7 +74,7 @@ Analyze recent {number_of_commits} and update documentation to match current cod - Keep structure flat when possible for better navigation - **Update index files**: When adding/modifying docs, always update relevant `index.md` files -8. Provide short summary of all changes made +9. Provide short summary of all changes made Be thorough and check: