Skip to content

Documentation#1

Merged
andhijeannot merged 8 commits intomainfrom
documentation
Mar 18, 2026
Merged

Documentation#1
andhijeannot merged 8 commits intomainfrom
documentation

Conversation

@andhijeannot
Copy link
Member

No description provided.

- scripts/audit-constitution.sh was untracked; CI could not find it
- Remove go version pin from .golangci.yml: golangci-lint v2.5.0 is
  built with Go 1.25 and rejects a config targeting Go 1.26
- Hook script now exits silently when no TTY is available so that
  non-interactive shells and --no-verify flows are unblocked
Superseded by git-msg. Kept only as historical context in PRD.md.
Remove .opencode/ (AI slash commands) and .specify/ (spec-driven
development scaffolding) from version control. Both directories are
added to .gitignore so they remain available locally but are never
published. specs/ is also explicitly ignored.
Update go.mod module path and all import paths, docs, CI config,
and the audit script to use github.com/madstone-tech/git-msg.
Add to .gitignore alongside .opencode/ and .specify/.
Copilot AI review requested due to automatic review settings March 18, 2026 21:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the repository’s public-facing documentation and project metadata after a module/repo rename, while also cleaning out internal spec-generation tooling and tightening git-hook behavior to avoid running interactive UI in non-TTY contexts.

Changes:

  • Rename the Go module/import path to github.com/madstone-tech/git-msg across code, tests, and release docs.
  • Add a full docs set (README + docs pages) and GitHub issue templates; remove legacy/internal planning/spec tooling files.
  • Add a “constitution” audit script and update the installed git hook script to skip generation when no TTY is present.

Reviewed changes

Copilot reviewed 72 out of 73 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
scripts/audit-constitution.sh New bash audit script enforcing architectural/import constraints.
main.go Update import path to new module path.
go.mod Update module path to github.com/madstone-tech/git-msg.
cmd/root.go Update imports to new module path.
cmd/root_cobra.go Update imports to new module path.
cmd/root_test.go Update imports to new module path.
cmd/generate.go Update imports to new module path.
cmd/generate_cobra.go Update imports to new module path.
cmd/generate_test.go Update imports to new module path.
cmd/config.go Update imports to new module path.
cmd/config_cobra.go Update imports to new module path.
cmd/config_test.go Update imports to new module path.
cmd/prompt.go Update imports to new module path.
cmd/prompt_cobra.go Update imports to new module path.
cmd/prompt_test.go Update imports to new module path.
cmd/llm.go Update imports to new module path.
cmd/llm_test.go Update imports to new module path.
cmd/hook.go Update imports to new module path.
cmd/hook_cobra.go Update imports to new module path.
cmd/hook_test.go Update imports to new module path.
internal/config/file.go Update imports to new module path.
internal/config/file_test.go Update imports to new module path.
internal/prompt/file.go Update imports to new module path.
internal/prompt/renderer_test.go Update imports to new module path.
internal/prompt/store_test.go Update imports to new module path.
internal/secret/keychain_test.go Update imports to new module path.
internal/ui/setup_test.go Update imports to new module path.
internal/git/branch_test.go Update imports to new module path.
internal/git/diff_test.go Update imports to new module path.
internal/git/log_test.go Update imports to new module path.
internal/llm/anthropic_test.go Update imports to new module path.
internal/llm/gemini_test.go Update imports to new module path.
internal/llm/ollama_test.go Update imports to new module path.
internal/llm/openai_test.go Update imports to new module path.
internal/hook/install.go Add TTY guard to generated hook script.
internal/hook/install_test.go Update imports to new module path.
internal/hook/source_test.go Update imports to new module path.
.goreleaser.yaml Update go install path to new module path.
.golangci.yml Remove pinned Go version setting in golangci config.
.gitignore Ignore internal/local dev tooling directories (.specify/, .opencode/, specs/, etc.).
README.md New README with usage + links to docs.
docs/getting-started.md New getting-started guide.
docs/configuration.md New configuration reference guide.
docs/cli-reference.md New CLI reference.
docs/providers.md New provider setup guide.
docs/prompt-templates.md New prompt template format/usage guide.
docs/git-hook.md New git-hook installation/behavior guide.
.github/ISSUE_TEMPLATE/config.yml Add issue template configuration.
.github/ISSUE_TEMPLATE/bug_report.yml Add bug report issue template.
.github/ISSUE_TEMPLATE/feature_request.yml Add feature request issue template.
git-gemini-commit.sh Remove legacy Gemini commit helper script.
PRD.md Remove PRD document from repo root.
.specify/memory/constitution.md Remove internal constitution file.
.specify/templates/tasks-template.md Remove internal template.
.specify/templates/spec-template.md Remove internal template.
.specify/templates/plan-template.md Remove internal template.
.specify/templates/constitution-template.md Remove internal template.
.specify/templates/checklist-template.md Remove internal template.
.specify/templates/agent-file-template.md Remove internal template.
.specify/scripts/bash/common.sh Remove internal scripting.
.specify/scripts/bash/create-new-feature.sh Remove internal scripting.
.specify/scripts/bash/setup-plan.sh Remove internal scripting.
.specify/scripts/bash/check-prerequisites.sh Remove internal scripting.
.specify/scripts/bash/update-agent-context.sh Remove internal scripting.
.opencode/command/speckit.specify.md Remove internal opencode command.
.opencode/command/speckit.plan.md Remove internal opencode command.
.opencode/command/speckit.tasks.md Remove internal opencode command.
.opencode/command/speckit.taskstoissues.md Remove internal opencode command.
.opencode/command/speckit.implement.md Remove internal opencode command.
.opencode/command/speckit.analyze.md Remove internal opencode command.
.opencode/command/speckit.clarify.md Remove internal opencode command.
.opencode/command/speckit.checklist.md Remove internal opencode command.
.opencode/command/speckit.constitution.md Remove internal opencode command.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines 10 to 17
const hookScript = `#!/bin/sh
# Managed by git-msg. Do not edit manually.
# Skip generation when there is no interactive terminal (e.g. --no-verify,
# non-interactive shells, or CI environments).
if ! [ -t 1 ]; then
exit 0
fi
exec git-msg generate --hook-mode --hook-msg-file "$1" --hook-source "${2:-}"
Comment on lines 10 to 18
const hookScript = `#!/bin/sh
# Managed by git-msg. Do not edit manually.
# Skip generation when there is no interactive terminal (e.g. --no-verify,
# non-interactive shells, or CI environments).
if ! [ -t 1 ]; then
exit 0
fi
exec git-msg generate --hook-mode --hook-msg-file "$1" --hook-source "${2:-}"
`
docs/git-hook.md Outdated
Comment on lines +42 to +55
# Skip generation when there is no interactive terminal (e.g. --no-verify,
# non-interactive shells, or CI environments).
if ! [ -t 1 ]; then
exit 0
fi
exec git-msg generate --hook-mode --hook-msg-file "$1" --hook-source "${2:-}"
```

Key behaviours:

- **No TTY, no generation** — the script exits silently when `stdout` is not
an interactive terminal. This prevents the hook from blocking in CI, editor
integrations, or `--no-verify` flows.
- **Hook mode** — `git-msg` writes the generated message to the commit message
Comment on lines +38 to +50
while IFS= read -r -d '' file; do
# Only non-cobra logic files
if [[ "$file" == *"_cobra.go" ]]; then
continue
fi
if grep -q '"github.com/spf13/cobra"' "$file"; then
fail "Cobra import in logic file: $file" \
"Non-_cobra.go files must not import cobra. Move wiring to $(basename "${file%.go}")_cobra.go"
fi
done < <(find "$ROOT/cmd" -name "*.go" -not -name "*_test.go" -print0)

pass "cmd/*.go (non-cobra) files have no cobra imports"

Comment on lines +57 to +63
while IFS= read -r -d '' file; do
if grep -qE '"github.com/madstone-tech/git-msg/internal/(config|secret|git|llm|prompt|hook|dirs)"' "$file"; then
IMPORT=$(grep -E '"github.com/madstone-tech/git-msg/internal/' "$file" | head -1 | xargs)
fail "internal/ui imports another internal package: $file" \
"Found: $IMPORT" \
"ui must return plain values. Persistence belongs in cmd/root.go:EnsureConfig."
fi
v2.5.0 was built with Go 1.25 and rejected go.mod targeting Go 1.26.
v2.11.3 is the current release and supports Go 1.26.
C1+C3: Hook TTY guard checks stdin (-t 0) not stdout (-t 1). The review
TUI reads from stdin so that is the correct descriptor to test. Update
the comment and docs to remove the incorrect --no-verify reference.

C2: Export HookScript constant and add TestFileManager_Install_ScriptContent
which asserts the installed file matches exactly and explicitly checks
for '-t 0' guard and exec line.

C4: Audit script pass() was unconditional — violations in a loop still
printed a green pass line. Replace with check_pass() which compares
VIOLATIONS before and after each block.

C5: internal/ui import check now greps for any internal/ import rather
than a hardcoded package list, so future packages are caught automatically.
@andhijeannot andhijeannot merged commit 48b31b1 into main Mar 18, 2026
6 checks passed
@andhijeannot andhijeannot deleted the documentation branch March 18, 2026 22:01
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.

2 participants