feat(agent/plugins): create plugins/{core-go,core-php,infra} tree (RFC.plugin-restructure §1+§2)
plugins/ subtree created from scratch (no dappcore-go/dappcore-php
existed to rename). Per docs/RFC-AGENT-PLUGIN-RESTRUCTURE.md:
plugins/core-go/:
- .claude-plugin/plugin.json (name: core-go)
- README.md, marketplace.yaml, .mcp.json (calls core mcp serve)
- commands/{commit,qa,review,verify}.md
- skills/{core,core-go,go-agent}/SKILL.md (seeded from existing repo material)
- skills/api-endpoints/SKILL.md (NEW per ticket)
- agents/go-developer.md
- hook scripts referenced by commands
plugins/core-php/: same structure, php-developer agent + php-specific
api-endpoints skill.
plugins/infra/: plugin.json, README.md, marketplace.yaml, agents/infra-ops.md.
Manifests use core-* not dappcore-*. .mcp.json files call core mcp serve.
No dappcore-* names left.
Note: seed skills copied from existing repo material per ticket spec —
some upstream Host UK examples remain in copied skill docs. Future PR
can purge those if Host UK references are out of scope for the public
plugin marketplace.
Co-authored-by: Codex <noreply@openai.com>
Closes tasks.lthn.sh/view.php?id=234
2026-04-25 20:04:50 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
# Smart commit script for /core:commit command
|
|
|
|
|
|
|
|
|
|
CUSTOM_MESSAGE=""
|
|
|
|
|
AMEND_FLAG=""
|
|
|
|
|
|
|
|
|
|
# Parse arguments
|
|
|
|
|
while (( "$#" )); do
|
|
|
|
|
case "$1" in
|
|
|
|
|
--amend)
|
|
|
|
|
AMEND_FLAG="--amend"
|
|
|
|
|
shift
|
|
|
|
|
;;
|
|
|
|
|
-*)
|
|
|
|
|
echo "Unsupported flag $1" >&2
|
|
|
|
|
exit 1
|
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
# The rest of the arguments are treated as the commit message
|
|
|
|
|
CUSTOM_MESSAGE="$@"
|
|
|
|
|
break
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
# Get staged changes
|
|
|
|
|
STAGED_FILES=$(git diff --staged --name-status)
|
|
|
|
|
|
2026-04-27 13:39:24 +01:00
|
|
|
if [[ -z "$STAGED_FILES" ]]; then
|
feat(agent/plugins): create plugins/{core-go,core-php,infra} tree (RFC.plugin-restructure §1+§2)
plugins/ subtree created from scratch (no dappcore-go/dappcore-php
existed to rename). Per docs/RFC-AGENT-PLUGIN-RESTRUCTURE.md:
plugins/core-go/:
- .claude-plugin/plugin.json (name: core-go)
- README.md, marketplace.yaml, .mcp.json (calls core mcp serve)
- commands/{commit,qa,review,verify}.md
- skills/{core,core-go,go-agent}/SKILL.md (seeded from existing repo material)
- skills/api-endpoints/SKILL.md (NEW per ticket)
- agents/go-developer.md
- hook scripts referenced by commands
plugins/core-php/: same structure, php-developer agent + php-specific
api-endpoints skill.
plugins/infra/: plugin.json, README.md, marketplace.yaml, agents/infra-ops.md.
Manifests use core-* not dappcore-*. .mcp.json files call core mcp serve.
No dappcore-* names left.
Note: seed skills copied from existing repo material per ticket spec —
some upstream Host UK examples remain in copied skill docs. Future PR
can purge those if Host UK references are out of scope for the public
plugin marketplace.
Co-authored-by: Codex <noreply@openai.com>
Closes tasks.lthn.sh/view.php?id=234
2026-04-25 20:04:50 +01:00
|
|
|
echo "No staged changes to commit."
|
|
|
|
|
exit 0
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Determine commit type and scope
|
|
|
|
|
COMMIT_TYPE="chore" # Default to chore
|
|
|
|
|
SCOPE=""
|
|
|
|
|
|
|
|
|
|
# Get just the file paths
|
|
|
|
|
STAGED_FILE_PATHS=$(git diff --staged --name-only)
|
|
|
|
|
|
|
|
|
|
# Determine type from file paths/status
|
|
|
|
|
# Order is important here: test and docs are more specific than feat.
|
|
|
|
|
if echo "$STAGED_FILE_PATHS" | grep -q -E "(_test\.go|\.test\.js|/tests/|/spec/)"; then
|
|
|
|
|
COMMIT_TYPE="test"
|
|
|
|
|
elif echo "$STAGED_FILE_PATHS" | grep -q -E "(\.md|/docs/|README)"; then
|
|
|
|
|
COMMIT_TYPE="docs"
|
|
|
|
|
elif echo "$STAGED_FILES" | grep -q "^A"; then
|
|
|
|
|
COMMIT_TYPE="feat"
|
|
|
|
|
elif git diff --staged | grep -q -E "^\+.*(fix|bug|issue)"; then
|
|
|
|
|
COMMIT_TYPE="fix"
|
|
|
|
|
elif git diff --staged | grep -q -E "^\+.*(refactor|restructure)"; then
|
|
|
|
|
COMMIT_TYPE="refactor"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Determine scope from the most common path component
|
2026-04-27 13:39:24 +01:00
|
|
|
if [[ -n "$STAGED_FILE_PATHS" ]]; then
|
feat(agent/plugins): create plugins/{core-go,core-php,infra} tree (RFC.plugin-restructure §1+§2)
plugins/ subtree created from scratch (no dappcore-go/dappcore-php
existed to rename). Per docs/RFC-AGENT-PLUGIN-RESTRUCTURE.md:
plugins/core-go/:
- .claude-plugin/plugin.json (name: core-go)
- README.md, marketplace.yaml, .mcp.json (calls core mcp serve)
- commands/{commit,qa,review,verify}.md
- skills/{core,core-go,go-agent}/SKILL.md (seeded from existing repo material)
- skills/api-endpoints/SKILL.md (NEW per ticket)
- agents/go-developer.md
- hook scripts referenced by commands
plugins/core-php/: same structure, php-developer agent + php-specific
api-endpoints skill.
plugins/infra/: plugin.json, README.md, marketplace.yaml, agents/infra-ops.md.
Manifests use core-* not dappcore-*. .mcp.json files call core mcp serve.
No dappcore-* names left.
Note: seed skills copied from existing repo material per ticket spec —
some upstream Host UK examples remain in copied skill docs. Future PR
can purge those if Host UK references are out of scope for the public
plugin marketplace.
Co-authored-by: Codex <noreply@openai.com>
Closes tasks.lthn.sh/view.php?id=234
2026-04-25 20:04:50 +01:00
|
|
|
# Extract the second component of each path (e.g., 'code' from 'claude/code/file.md')
|
|
|
|
|
# This is a decent heuristic for module name.
|
|
|
|
|
# We filter for lines that have a second component.
|
|
|
|
|
POSSIBLE_SCOPES=$(echo "$STAGED_FILE_PATHS" | grep '/' | cut -d/ -f2)
|
|
|
|
|
|
2026-04-27 13:39:24 +01:00
|
|
|
if [[ -n "$POSSIBLE_SCOPES" ]]; then
|
feat(agent/plugins): create plugins/{core-go,core-php,infra} tree (RFC.plugin-restructure §1+§2)
plugins/ subtree created from scratch (no dappcore-go/dappcore-php
existed to rename). Per docs/RFC-AGENT-PLUGIN-RESTRUCTURE.md:
plugins/core-go/:
- .claude-plugin/plugin.json (name: core-go)
- README.md, marketplace.yaml, .mcp.json (calls core mcp serve)
- commands/{commit,qa,review,verify}.md
- skills/{core,core-go,go-agent}/SKILL.md (seeded from existing repo material)
- skills/api-endpoints/SKILL.md (NEW per ticket)
- agents/go-developer.md
- hook scripts referenced by commands
plugins/core-php/: same structure, php-developer agent + php-specific
api-endpoints skill.
plugins/infra/: plugin.json, README.md, marketplace.yaml, agents/infra-ops.md.
Manifests use core-* not dappcore-*. .mcp.json files call core mcp serve.
No dappcore-* names left.
Note: seed skills copied from existing repo material per ticket spec —
some upstream Host UK examples remain in copied skill docs. Future PR
can purge those if Host UK references are out of scope for the public
plugin marketplace.
Co-authored-by: Codex <noreply@openai.com>
Closes tasks.lthn.sh/view.php?id=234
2026-04-25 20:04:50 +01:00
|
|
|
SCOPE=$(echo "$POSSIBLE_SCOPES" | sort | uniq -c | sort -nr | head -n 1 | awk '{print $2}')
|
|
|
|
|
fi
|
|
|
|
|
# If no scope is found (e.g., all files are in root), SCOPE remains empty, which is valid.
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Construct the commit message
|
2026-04-27 13:39:24 +01:00
|
|
|
if [[ -n "$CUSTOM_MESSAGE" ]]; then
|
feat(agent/plugins): create plugins/{core-go,core-php,infra} tree (RFC.plugin-restructure §1+§2)
plugins/ subtree created from scratch (no dappcore-go/dappcore-php
existed to rename). Per docs/RFC-AGENT-PLUGIN-RESTRUCTURE.md:
plugins/core-go/:
- .claude-plugin/plugin.json (name: core-go)
- README.md, marketplace.yaml, .mcp.json (calls core mcp serve)
- commands/{commit,qa,review,verify}.md
- skills/{core,core-go,go-agent}/SKILL.md (seeded from existing repo material)
- skills/api-endpoints/SKILL.md (NEW per ticket)
- agents/go-developer.md
- hook scripts referenced by commands
plugins/core-php/: same structure, php-developer agent + php-specific
api-endpoints skill.
plugins/infra/: plugin.json, README.md, marketplace.yaml, agents/infra-ops.md.
Manifests use core-* not dappcore-*. .mcp.json files call core mcp serve.
No dappcore-* names left.
Note: seed skills copied from existing repo material per ticket spec —
some upstream Host UK examples remain in copied skill docs. Future PR
can purge those if Host UK references are out of scope for the public
plugin marketplace.
Co-authored-by: Codex <noreply@openai.com>
Closes tasks.lthn.sh/view.php?id=234
2026-04-25 20:04:50 +01:00
|
|
|
COMMIT_MESSAGE="$CUSTOM_MESSAGE"
|
|
|
|
|
else
|
|
|
|
|
# Auto-generate a descriptive summary
|
|
|
|
|
DIFF_CONTENT=$(git diff --staged)
|
|
|
|
|
# Try to find a function or class name from the diff
|
|
|
|
|
# This is a simple heuristic that can be greatly expanded.
|
|
|
|
|
SUMMARY=$(echo "$DIFF_CONTENT" | grep -E -o "(function|class|def) \w+" | head -n 1 | sed -e 's/function //g' -e 's/class //g' -e 's/def //g')
|
|
|
|
|
|
2026-04-27 13:39:24 +01:00
|
|
|
if [[ -z "$SUMMARY" ]]; then
|
|
|
|
|
if [[ $(echo "$STAGED_FILE_PATHS" | wc -l) -eq 1 ]]; then
|
feat(agent/plugins): create plugins/{core-go,core-php,infra} tree (RFC.plugin-restructure §1+§2)
plugins/ subtree created from scratch (no dappcore-go/dappcore-php
existed to rename). Per docs/RFC-AGENT-PLUGIN-RESTRUCTURE.md:
plugins/core-go/:
- .claude-plugin/plugin.json (name: core-go)
- README.md, marketplace.yaml, .mcp.json (calls core mcp serve)
- commands/{commit,qa,review,verify}.md
- skills/{core,core-go,go-agent}/SKILL.md (seeded from existing repo material)
- skills/api-endpoints/SKILL.md (NEW per ticket)
- agents/go-developer.md
- hook scripts referenced by commands
plugins/core-php/: same structure, php-developer agent + php-specific
api-endpoints skill.
plugins/infra/: plugin.json, README.md, marketplace.yaml, agents/infra-ops.md.
Manifests use core-* not dappcore-*. .mcp.json files call core mcp serve.
No dappcore-* names left.
Note: seed skills copied from existing repo material per ticket spec —
some upstream Host UK examples remain in copied skill docs. Future PR
can purge those if Host UK references are out of scope for the public
plugin marketplace.
Co-authored-by: Codex <noreply@openai.com>
Closes tasks.lthn.sh/view.php?id=234
2026-04-25 20:04:50 +01:00
|
|
|
FIRST_FILE=$(echo "$STAGED_FILE_PATHS" | head -n 1)
|
|
|
|
|
SUMMARY="update $(basename "$FIRST_FILE")"
|
|
|
|
|
else
|
|
|
|
|
SUMMARY="update multiple files"
|
|
|
|
|
fi
|
|
|
|
|
else
|
|
|
|
|
SUMMARY="update $SUMMARY"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
SUBJECT="$COMMIT_TYPE($SCOPE): $SUMMARY"
|
|
|
|
|
BODY=$(echo "$DIFF_CONTENT" | grep -E "^\+" | sed -e 's/^+//' | head -n 5 | sed 's/^/ - /')
|
|
|
|
|
COMMIT_MESSAGE="$SUBJECT\n\n$BODY"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Add Co-Authored-By trailer
|
|
|
|
|
CO_AUTHOR="Co-Authored-By: Claude <noreply@anthropic.com>"
|
|
|
|
|
if ! echo "$COMMIT_MESSAGE" | grep -q "$CO_AUTHOR"; then
|
|
|
|
|
COMMIT_MESSAGE="$COMMIT_MESSAGE\n\n$CO_AUTHOR"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Execute the commit
|
|
|
|
|
git commit $AMEND_FLAG -m "$(echo -e "$COMMIT_MESSAGE")"
|
|
|
|
|
|
2026-04-27 13:39:24 +01:00
|
|
|
if [[ $? -eq 0 ]]; then
|
feat(agent/plugins): create plugins/{core-go,core-php,infra} tree (RFC.plugin-restructure §1+§2)
plugins/ subtree created from scratch (no dappcore-go/dappcore-php
existed to rename). Per docs/RFC-AGENT-PLUGIN-RESTRUCTURE.md:
plugins/core-go/:
- .claude-plugin/plugin.json (name: core-go)
- README.md, marketplace.yaml, .mcp.json (calls core mcp serve)
- commands/{commit,qa,review,verify}.md
- skills/{core,core-go,go-agent}/SKILL.md (seeded from existing repo material)
- skills/api-endpoints/SKILL.md (NEW per ticket)
- agents/go-developer.md
- hook scripts referenced by commands
plugins/core-php/: same structure, php-developer agent + php-specific
api-endpoints skill.
plugins/infra/: plugin.json, README.md, marketplace.yaml, agents/infra-ops.md.
Manifests use core-* not dappcore-*. .mcp.json files call core mcp serve.
No dappcore-* names left.
Note: seed skills copied from existing repo material per ticket spec —
some upstream Host UK examples remain in copied skill docs. Future PR
can purge those if Host UK references are out of scope for the public
plugin marketplace.
Co-authored-by: Codex <noreply@openai.com>
Closes tasks.lthn.sh/view.php?id=234
2026-04-25 20:04:50 +01:00
|
|
|
echo "Commit successful."
|
|
|
|
|
else
|
|
|
|
|
echo "Commit failed."
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|