Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Bug
about: The megaplan skill or validator did not work as documented
labels: ""
---

**What was run**
<!-- The prompt or command, and the context involved. -->

**Host** (name and version)

**Megaplan version**
<!-- For example v0.1.0. -->

**Expected**

**Actual**

**Output excerpt**
<!-- Paste the relevant part of the agent's output. Redact local paths and secrets. -->

<!-- Security problems: do not file here. See SECURITY.md. -->
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Report a security vulnerability
url: https://github.com/Gamebreack/megaplan/security/advisories/new
about: Report security problems privately, not as a public issue.
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/idea.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Idea
about: Propose a change or improvement
labels: ""
---

**Problem**
<!-- What gets in the way, and for whom? -->

**Proposed change**
<!-- What would you change? Say what you tried, if anything. -->

---

Changes should keep Megaplan portable and simple: plain instructions, no runner, no host adapters.
12 changes: 12 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## What and why

<!-- What changes, and the problem it solves. Link the issue if there is one. -->

## Hosts tested in

<!-- Host and version, or "docs only". -->

## Checklist

- [ ] Follows the rules in AGENTS.md
- [ ] The [pre-PR checklist](https://github.com/Gamebreack/megaplan/blob/main/CONTRIBUTING.md#before-you-open-a-pull-request) is done
34 changes: 34 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Validate

on:
push:
pull_request:

permissions:
contents: read

jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
with:
persist-credentials: false
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: "3.12"
- name: Run gitleaks secret scan
run: |
curl -fsSL -o /tmp/gitleaks.tar.gz https://github.com/gitleaks/gitleaks/releases/download/v8.30.1/gitleaks_8.30.1_linux_x64.tar.gz
echo "551f6fc83ea457d62a0d98237cbad105af8d557003051f41f3e7ca7b3f2470eb /tmp/gitleaks.tar.gz" | sha256sum -c -
mkdir -p /tmp/gitleaks
tar -xzf /tmp/gitleaks.tar.gz -C /tmp/gitleaks gitleaks
/tmp/gitleaks/gitleaks dir --no-banner --redact .
- name: Run repository guards
run: MEGAPLAN_PRE_PUSH_GUARDS_ONLY=1 scripts/hooks/pre_push.sh
Comment thread
Gamebreack marked this conversation as resolved.
Resolved
- name: Check doc line limits
run: scripts/check-doc-length.sh
- name: Validate skill
run: python3 scripts/validate.py
- name: Run tests
run: python3 -m unittest discover -s tests -v
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
.slim/

# Local secrets
.env
.env.*

# Python bytecode, caches, and virtualenvs
__pycache__/
*.py[cod]
.pytest_cache/
.ruff_cache/
.venv/

# Logs, temporary files, backups, and editor/OS metadata
*.log
*.tmp
*.bak
*~
*.swp
*.swo
.DS_Store
Thumbs.db
Comment thread
Gamebreack marked this conversation as resolved.
Resolved
79 changes: 79 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Git hooks (pre-commit framework). Install once per clone: `pre-commit install` (installs the commit and push hooks).
# Run all commit-stage hooks: `pre-commit run --all-files`. Never bypass with --no-verify.
default_install_hook_types: [pre-commit, pre-push]
default_stages: [pre-commit]

repos:
- repo: https://github.com/gitleaks/gitleaks
rev: v8.30.1
hooks:
- id: gitleaks

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
# stages pinned: these hooks' manifests also declare other stages; all are pinned for consistency.
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
stages: [pre-commit]
- id: end-of-file-fixer
stages: [pre-commit]
- id: check-yaml
stages: [pre-commit]
- id: check-merge-conflict
args: [--assume-in-merge]
stages: [pre-commit]
- id: check-added-large-files
stages: [pre-commit]

- repo: local
hooks:
# Limit lives in AGENTS.md (Hard rules); the script holds the numbers and the exempt list.
- id: doc-length
name: doc line limits (CONTEXT.md < 80, other Markdown < 200)
entry: scripts/check-doc-length.sh
language: system
pass_filenames: false
always_run: true
stages: [pre-commit]

- id: validate
name: validator (megaplan frontmatter, links, sections, templates)
entry: python3 scripts/validate.py
language: system
pass_filenames: false
always_run: true
stages: [pre-commit]

# The lookbehind skips URL paths (https://host/home/x). This config is excluded because the regex text itself contains the prefixes.
- id: no-absolute-home-path
name: portability guard (no absolute home paths)
description: Machine-specific paths never enter this repo (see AGENTS.md).
entry: '(?<![A-Za-z0-9._~-])(/home/|/Users/|/mnt/[A-Za-z]/Users/|[A-Za-z]:[/\\]Users[/\\])[\w.-]+'
language: pygrep
types: [text]
exclude: ^\.pre-commit-config\.yaml$
stages: [pre-commit]

- id: no-env-file
name: secrets guard (no .env files)
entry: .env files must not be committed
language: fail
files: (^|/)\.env(\..*)?$
stages: [pre-commit]

- id: no-local-context
name: local planning files (root CONTEXT.md, docs/megaplan/) are never committed
entry: root CONTEXT.md and docs/megaplan/ stay local and git-excluded; do not commit them
language: fail
files: (^CONTEXT\.md$|^docs/megaplan/)
stages: [pre-commit]

# Whole-repo guards (tracked .env files, root CONTEXT.md, docs/megaplan/, home paths), then the checks CI runs; does not re-invoke pre-commit (no recursion).
- id: pre-push-checks
name: pre-push checks (.env, home paths, doc length, validator, tests)
entry: scripts/hooks/pre_push.sh
language: system
pass_filenames: false
always_run: true
stages: [pre-push]
22 changes: 22 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Megaplan — repo rules

This repo holds the `megaplan` Agent Skill (plan-tracking methodology for AI coding agents: scoping items, durable ADRs, a live backlog, and resumable logs) and standard-library validation tooling. Releases: see [CHANGELOG.md](CHANGELOG.md).

## Hard rules

- No commits, pushes, tags, releases or remote changes without explicit operator authorization. Workers never commit or push. Before committing, run pre-commit hooks; never use `--no-verify`.
- Maintainers: feature branches merge into a single development branch (`dev`); only `dev` is pushed and PRed to `main`. Outside contributors open the PR from a fork.
- The skill under `skills/megaplan/` stays host-agnostic: no host, harness, agent-type, model or provider names, and no runner or adapter.
- The skill name stays lowercase `megaplan` (Agent Skills naming). The project and repository are called Megaplan.
- One home per fact: link instead of copying.
- Reference docs stay under 200 lines (`scripts/check-doc-length.sh`).
- Secrets, credentials, personal endpoints, personal or employer names and machine-specific paths never enter the repo.
- When the flow of the skill changes, update `flow-map.md` in the same pull request.

## Required checks

The commands are in [CONTRIBUTING.md](CONTRIBUTING.md#required-checks); they must pass before merge and release.

## Planning

If a locally excluded `CONTEXT.md` exists at the root, read it first; local planning files are never committed. Releases: see [CONTRIBUTING.md](CONTRIBUTING.md).
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Changelog

All notable changes to this project are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html); see [CONTRIBUTING.md](CONTRIBUTING.md) (Releasing).

## [Unreleased]

## [2.0.0] - 2026-11-29

### Changed
- **Breaking:** redesigned Markdown skill and directory structure from v1 machinery to the v2 plan-tracking methodology (`megaplan` skill).
- Two-tier visibility model separating durable ADRs (`docs/adr/`) from ephemeral process logs and backlogs (`docs/megaplan/`).
- Spec-first entry path and structured conversational interview for scoping items.
- Item file schema updated with `## Outcome`, `## Scope`, `## Touches`, `## Not touching`, `## Acceptance`, optional `## Cut`, and dated `## Log` (log outranks scope).
- Added `blocked` status in backlog items, and removed the old `## Attack` section (independent review/verification now handled externally).
- Finish rule updated: operator writes `done.md` line; item file is deleted if git-tracked or archived if git-excluded.
- Repository tooling added: pre-commit and pre-push hooks, standard-library validator (`scripts/validate.py`), tests, CI workflow, and full documentation.

[Unreleased]: https://github.com/Gamebreack/megaplan/compare/v2.0.0...HEAD
[2.0.0]: https://github.com/Gamebreack/megaplan/releases/tag/v2.0.0
107 changes: 107 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Contributing

Thanks for helping. This guide takes you from a clone to a pull request. The [rules in AGENTS.md](AGENTS.md) apply to every change and are not repeated here.

## Where to go

| You want to… | Go to |
|---|---|
| Report a bug | [Bug issue](https://github.com/Gamebreack/megaplan/issues/new?template=bug.md) |
| Suggest an improvement | [Idea issue](https://github.com/Gamebreack/megaplan/issues/new?template=idea.md) |
| Report a security problem | [SECURITY.md](SECURITY.md), privately, never as a public issue |
| See what changed | [CHANGELOG.md](CHANGELOG.md) |

## Quick start

| Step | Command or action |
|---|---|
| 1. Get the code | Maintainers: `git clone https://github.com/Gamebreack/megaplan.git`. Outside contributors: fork first, then `git clone https://github.com/<your-account>/megaplan.git` |
| 2. Install the hooks (once per clone) | `cd megaplan`, then `pre-commit install` (needs [pre-commit](https://pre-commit.com)) |
| 3. Make the change | on a feature branch |
| 4. Run the checks | the [required checks](#required-checks) |
| 5. Propose it | open a pull request against `main` (maintainers from `dev`, contributors from their fork) |

## Required checks

CI runs these commands. They must pass before merge and before release. Python 3.9 or later.

```bash
gitleaks dir --no-banner --redact .
MEGAPLAN_PRE_PUSH_GUARDS_ONLY=1 scripts/hooks/pre_push.sh
scripts/check-doc-length.sh
python3 scripts/validate.py
python3 -m unittest discover -s tests
```

## How a change flows

The diagram shows the maintainer path. Solid lines are every change; the dashed box is a release.

```mermaid
%%{init: {"theme":"base","themeVariables":{"fontFamily":"system-ui, -apple-system, Segoe UI, sans-serif","fontSize":"15px","primaryTextColor":"#1b221e","lineColor":"#8a968f","clusterBkg":"transparent","clusterBorder":"#b7c0ba","titleColor":"#5d6962","edgeLabelBackground":"#ffffff"},"flowchart":{"curve":"basis","nodeSpacing":22,"rankSpacing":30,"padding":14,"htmlLabels":true}}}%%
flowchart LR
F["<b>Feature branch</b><br/>local only"]
H["<b>Commit hooks</b><br/>secrets, limits, validator"]
D["<b>dev</b><br/>the one pushed branch"]
P["<b>Pull request</b><br/>CI + review"]
M["<b>main</b>"]
R["<b>Release</b><br/>tag + GitHub release"]

F --> H
H -->|"merge"| D
D -->|"push hook, PR"| P
P -->|"merge"| M
M -.->|"when releasing"| R

classDef p1 fill:#dbe8f6,stroke:#4a7fb5,color:#1b221e
classDef p2 fill:#fbefd2,stroke:#c3962c,color:#1b221e
classDef p3 fill:#d8eee2,stroke:#3f8f68,color:#1b221e
classDef side fill:#f5f6f5,stroke:#a9b4ad,color:#5d6962,stroke-dasharray:4 3
class F,H p1
class D,P p2
class M p3
class R side
linkStyle 4 stroke:#8a968f,stroke-width:1.5px,stroke-dasharray:2 3
```

**Branches:** the branch rule is in [AGENTS.md](AGENTS.md#hard-rules).

## Before you open a pull request

- [ ] All [required checks](#required-checks) pass
- [ ] `pre-commit run --all-files` passes, without bypassing hooks ([hard rules](AGENTS.md#hard-rules))
- [ ] `CHANGELOG.md` has an entry under `[Unreleased]`, or the change is not user-facing
- [ ] The [hard rules in AGENTS.md](AGENTS.md#hard-rules) hold (including the flow-map rule)

## What the hooks check

Hooks run on commit and on push. Fix what they report.

| Hook | When | What it does |
|---|---|---|
| Secret scan (gitleaks) | commit | blocks credentials and tokens |
| `.env`, `CONTEXT.md`, and `docs/megaplan/` guards | commit | keeps environment files and local planning out of git |
| Hygiene | commit | trailing whitespace, end of file, YAML, merge markers, large files |
| Line limits | commit | doc line limits (see AGENTS.md) |
| Portability guard | commit | no absolute home paths |
| Validator | commit | frontmatter, links and the skill's content check |
| `scripts/hooks/pre_push.sh` | push | checks the checkout and pushed files for forbidden paths, then runs checks and tests |

## Versioning

Versions are SemVer tags only (for example `v2.0.0`), applied to the skill's behavior:

| Bump | When |
|---|---|
| Patch | wording and template fixes that do not change what the skill asks of an agent |
| Minor | new or changed workflow or structure rules |
| Major | a breaking change to how Megaplan tracks plans or items |

## Releasing

For maintainers. Work through the steps in order; each one gates the next.

1. In a pull request, move the `[Unreleased]` entries in `CHANGELOG.md` under `## [X.Y.Z] - YYYY-MM-DD` and update the compare links.
2. Run pre-release verification on that pull request while it is up to date with `main`: a fresh verifier run plus an independent review panel. Merge only with no open blocker findings.
3. Only with operator approval: after the pull request merges, create the annotated tag `vX.Y.Z` on the merge commit and push it.
4. Create the GitHub release with that version's changelog section as its notes: `gh release create vX.Y.Z --verify-tag --title "vX.Y.Z — <summary>" --notes-file <section>`.
Loading