Skip to content

feat: Add /project, /deploy, and /doc_sync commands#23

Open
james-cantonwine wants to merge 2 commits into
psd401:mainfrom
james-cantonwine:feat/add-project-deploy-docsync-commands
Open

feat: Add /project, /deploy, and /doc_sync commands#23
james-cantonwine wants to merge 2 commits into
psd401:mainfrom
james-cantonwine:feat/add-project-deploy-docsync-commands

Conversation

@james-cantonwine
Copy link
Copy Markdown

Summary

  • /project [name] — Loads project context briefing (tech stack, git status, open issues/PRs, TODOs, key commands) to reduce context-switching cost across multiple active apps
  • /deploy [env] — Multi-platform deployment orchestration with pre-checks, auto-detection (AWS CDK, Railway, Cloudflare, Amplify, Cloud Run, GitHub Pages), and post-deploy verification
  • /doc_sync [project|all] — Documentation drift detector that cross-references CLAUDE.md/README against actual codebase for stale paths, outdated deps, missing env vars, and undocumented content

New files

File Type
commands/project.md Command
commands/deploy.md Command
commands/doc_sync.md Command
agents/deploy-verifier.md Agent — post-deploy smoke tests
agents/documentation-auditor.md Agent — docs-vs-code drift detection

Test plan

  • Verify commands appear in /psd-claude-coding-system: autocomplete after plugin reload
  • /project kangaroo returns structured briefing
  • /deploy dev runs pre-checks and detects platform
  • /doc_sync kangaroo identifies documentation drift

🤖 Generated with Claude Code

…gents

Three new commands to address gaps in deployment operations, project
navigation, and documentation freshness:

/project [name] - Loads project context briefing (tech stack, git status,
open issues/PRs, TODO items, key commands) to reduce context-switching
cost across 6+ active production apps. Read-only, no new agents needed.

/deploy [env] - Multi-platform deployment orchestration with 3 phases:
pre-deploy checks (clean tree, tests, types, branch), platform-specific
deploy (auto-detects AWS CDK, Railway, Cloudflare Workers, Amplify,
Cloud Run, GitHub Pages), and post-deploy verification via new
deploy-verifier agent. Requires user confirmation before executing.

/doc_sync [project|all] - Documentation drift detector that cross-references
CLAUDE.md and README.md against actual codebase. Checks file path validity,
command runnability, dependency accuracy, env var consistency, and
undocumented new content. Uses new documentation-auditor agent for analysis.
Proposes fixes with user approval before editing.

New agents:
- deploy-verifier: Post-deployment smoke testing and health verification
- documentation-auditor: Cross-references docs against code for drift detection
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @james-cantonwine, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the developer experience by introducing three powerful new commands. These commands automate critical development workflows: providing instant project context, ensuring robust and verified deployments across diverse platforms, and maintaining documentation accuracy by detecting and helping to resolve drift. The changes aim to streamline operations, reduce manual errors, and keep project information consistent and up-to-date.

Highlights

  • New /project command: Introduced a command to load project context briefings, including tech stack, Git status, open issues/PRs, TODOs, and key commands, to reduce context-switching.
  • New /deploy command: Added a multi-platform deployment orchestration command with pre-checks, auto-detection for various platforms (AWS CDK, Railway, Cloudflare, Amplify, Cloud Run, GitHub Pages), and post-deployment verification.
  • New /doc_sync command: Implemented a documentation drift detector that cross-references CLAUDE.md/README against the actual codebase to identify stale paths, outdated dependencies, missing environment variables, and undocumented content.
Changelog
  • plugins/psd-claude-coding-system/agents/deploy-verifier.md
    • Introduced the Deploy Verifier Agent for automated post-deployment smoke tests.
  • plugins/psd-claude-coding-system/agents/documentation-auditor.md
    • Introduced the Documentation Auditor Agent to detect and report documentation drift.
  • plugins/psd-claude-coding-system/commands/deploy.md
    • Added the /deploy command for orchestrating multi-platform deployments with pre-checks and post-verification.
  • plugins/psd-claude-coding-system/commands/doc_sync.md
    • Added the /doc_sync command to detect and facilitate fixing documentation inconsistencies.
  • plugins/psd-claude-coding-system/commands/project.md
    • Added the /project command to provide quick project context briefings, including tech stack, Git status, and open issues.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@james-cantonwine
Copy link
Copy Markdown
Author

@krishagel — Added 3 new commands and 2 supporting agents to fill gaps in deployment ops, project navigation, and documentation freshness. Details in the PR description. Let me know if you have any questions.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces several new commands and agents for project management, deployment, and documentation synchronization. The overall functionality is a great addition. I've identified a few areas for improvement, primarily focusing on enhancing the robustness and safety of the shell scripts. Key suggestions include making deployment environment selection explicit to prevent accidental production deploys, ensuring pre-deploy checks halt execution on failure, replacing unsafe ls parsing with more reliable methods, and fixing a few potential bugs in the scripts. Addressing these points will significantly improve the reliability and safety of these new commands.

### Phase 1: Environment & Project Detection

```bash
DEPLOY_ENV="${ARGUMENTS:-prod}"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

Defaulting the deployment environment to prod is extremely risky and can easily lead to accidental production deployments. The script should require an explicit environment argument and fail if it's not provided. This change is critical for preventing production accidents.

Suggested change
DEPLOY_ENV="${ARGUMENTS:-prod}"
DEPLOY_ENV="${ARGUMENTS:?ERROR: Deployment environment not specified. Please provide 'dev', 'staging', or 'prod'.}"

**File paths:**
```bash
# For each path mentioned in docs, check existence
test -e "$PATH" && echo "✓ $PATH" || echo "✗ $PATH (MISSING)"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Using PATH as a variable name is dangerous as it shadows the system's $PATH environment variable, which is essential for locating executables. This can lead to command not found errors and other unpredictable behavior. It's crucial to use a different variable name, such as file_path, to avoid this conflict.

Suggested change
test -e "$PATH" && echo "✓ $PATH" || echo "✗ $PATH (MISSING)"
test -e "$file_path" && echo "✓ $file_path" || echo "✗ $file_path (MISSING)"

HAS_TEST=$(node -e "const p=require('./package.json'); console.log(p.scripts && p.scripts.test ? 'yes' : 'no')" 2>/dev/null)
if [ "$HAS_TEST" = "yes" ]; then
echo "Running tests..."
bun test 2>&1 || npm test 2>&1 || echo "❌ FAIL: Tests failed"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The pre-deploy test check for Node.js projects only prints a failure message but does not stop the script. This contradicts the instruction to "Stop and report if any fail." A failed test run should immediately halt the deployment process to prevent deploying broken code.

Suggested change
bun test 2>&1 || npm test 2>&1 || echo "❌ FAIL: Tests failed"
(bun test || npm test) || { echo "❌ FAIL: Tests failed. Aborting deployment."; exit 1; }

fi
elif [ -f "pyproject.toml" ] || [ -f "pytest.ini" ]; then
echo "Running pytest..."
python -m pytest 2>&1 || echo "❌ FAIL: Tests failed"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The pre-deploy pytest check only prints a failure message but does not stop the script. This contradicts the instruction to "Stop and report if any fail." A failed test run should immediately halt the deployment process.

Suggested change
python -m pytest 2>&1 || echo "❌ FAIL: Tests failed"
python -m pytest 2>&1 || { echo "❌ FAIL: Tests failed. Aborting deployment."; exit 1; }

echo -e "\n--- Type Check ---"
if [ -f "tsconfig.json" ]; then
echo "Running typecheck..."
npx tsc --noEmit 2>&1 || bun run typecheck 2>&1 || echo "⚠ Type errors detected"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The pre-deploy type check only prints a warning but does not stop the script. This contradicts the instruction to "Stop and report if any fail." Type errors indicate potential bugs, and the deployment should be halted if they are detected.

Suggested change
npx tsc --noEmit 2>&1 || bun run typecheck 2>&1 || echo "Type errors detected"
(npx tsc --noEmit || bun run typecheck) 2>&1 || { echo "❌ FAIL: Type errors detected. Aborting deployment."; exit 1; }

Comment on lines +65 to +67
ls -d */ | while read dir; do
grep -q "${dir%/}" CLAUDE.md 2>/dev/null || echo "UNDOCUMENTED: $dir"
done
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Parsing the output of ls is unreliable and considered bad practice in shell scripting, as it can fail with filenames containing spaces or other special characters. A for loop with a glob pattern is a safer and more robust alternative for iterating over directories.

Suggested change
ls -d */ | while read dir; do
grep -q "${dir%/}" CLAUDE.md 2>/dev/null || echo "UNDOCUMENTED: $dir"
done
for dir in */; do
if [ -d "$dir" ]; then
grep -qF "${dir%/}" CLAUDE.md 2>/dev/null || echo "UNDOCUMENTED: $dir"
fi
done


**AWS CDK:**
```bash
cd infra && npx cdk deploy --all --require-approval broadening
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The script changes into the infra directory to run cdk deploy but does not change back. This can cause subsequent commands to fail if they expect to be in the project's root directory. Encapsulating the command in a subshell will prevent this issue by isolating the directory change.

Suggested change
cd infra && npx cdk deploy --all --require-approval broadening
(cd infra && npx cdk deploy --all --require-approval broadening)

Comment on lines +24 to +26
PROJECTS=$(ls -d "$HOME/code"/*/ 2>/dev/null | while read d; do
[ -f "$d/CLAUDE.md" ] && echo "$d"
done)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Parsing the output of ls is not robust and can fail if directory names contain spaces or special characters. Using find is a much safer and more reliable way to locate the project directories.

Suggested change
PROJECTS=$(ls -d "$HOME/code"/*/ 2>/dev/null | while read d; do
[ -f "$d/CLAUDE.md" ] && echo "$d"
done)
PROJECTS=$(find "$HOME/code" -mindepth 1 -maxdepth 1 -type d -exec test -f '{}/CLAUDE.md' \; -print)

allowed-tools: Bash(*), View, Task
description: Load project context and status briefing
argument-hint: [project name or path]
model: claude-sonnet-4-5
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This command file is missing the extended-thinking: true property in its frontmatter, which is present in the other new command files (deploy.md, doc_sync.md). For consistency and to ensure the AI has adequate time for complex context-loading tasks, this property should be added.

Suggested change
model: claude-sonnet-4-5
model: claude-sonnet-4-5
extended-thinking: true

else
echo "❌ Project not found: $TARGET"
echo "Available projects in ~/code/:"
ls -d "$HOME/code"/*/ 2>/dev/null | xargs -I{} basename {}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Parsing the output of ls and piping it to xargs is not a robust method and can fail with filenames containing spaces or special characters. Using find with -printf is a safer and more reliable way to list the directory names.

Suggested change
ls -d "$HOME/code"/*/ 2>/dev/null | xargs -I{} basename {}
find "$HOME/code"/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n'

Adds plugin-auto-update.sh to SessionStart hooks so the
psd-claude-coding-system plugin pulls latest changes from the repo
automatically. Uses a daily stamp file to avoid redundant checks —
only runs `claude plugin update` once per day. The update runs in a
background process so it never blocks session startup.

Files changed:
- scripts/plugin-auto-update.sh (new): background update with daily throttle
- hooks/hooks.json: added auto-update hook to SessionStart array
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant