Skip to content

Commit c7530cf

Browse files
fvarruiclaude
andcommitted
Add MiniSpec setup and CLAUDE.md
Initialize MiniSpec (falkenslab/minispec) with Claude integration and fill .minispec/core/ with the project's architecture, stack, conventions and glossary. CLAUDE.md keeps only build commands and the MiniSpec pointer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent e870712 commit c7530cf

17 files changed

Lines changed: 470 additions & 0 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: minispec-adr
3+
description: Record an architectural decision as a new ADR under .minispec/decisions/ from the ADR template. Use when an important, hard-to-reverse decision is made.
4+
---
5+
6+
# MiniSpec: new ADR
7+
8+
Record a permanent architectural decision under `.minispec/decisions/`.
9+
10+
## Steps
11+
12+
1. Read `.minispec/README.md` for the standard.
13+
2. Read the template `.minispec/templates/adr.md`.
14+
3. Determine the next sequential number: list `.minispec/decisions/`, find the
15+
highest `ADR-NNN-*` and add 1. Numbers are never reused or renumbered.
16+
4. Create `.minispec/decisions/ADR-NNN-<slug>.md` with `<slug>` in kebab-case.
17+
5. Fill the three sections:
18+
- **Decision** — what was decided, one or two sentences.
19+
- **Motivation** — why; what problem it solves, what was rejected.
20+
- **Consequences** — what it commits us to; trade-offs, follow-ups.
21+
22+
## Rules
23+
24+
- One page. No more. Document the *why*, not the implementation.
25+
- Only record decisions that are important and worth not re-litigating. Don't
26+
write an ADR for plain stack facts.
27+
- If the decision changes a rule, also update `.minispec/core/conventions.md`.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: minispec-bugfix
3+
description: Document a bug and its fix as a MiniSpec bugfix note under .minispec/features/ from the bugfix template. Use when fixing a non-trivial bug worth recording.
4+
---
5+
6+
# MiniSpec: new bugfix
7+
8+
Document a bug and its fix using the bugfix format. It is temporal knowledge, so
9+
it lives under `.minispec/features/`.
10+
11+
## Steps
12+
13+
1. Read `.minispec/README.md` for the standard.
14+
2. Read the template `.minispec/templates/bugfix.md`.
15+
3. Create `.minispec/features/fix-<slug>.md` with `<slug>` in kebab-case.
16+
4. Fill the four sections:
17+
- **Problem** — observable symptom.
18+
- **Cause** — root cause.
19+
- **Solution** — what was changed.
20+
- **Verification** — how the fix was confirmed.
21+
22+
## Rules
23+
24+
- Max 100 lines. Short and factual. Base it on the real diff.
25+
- Temporal: once the fix is merged and verified, delete this file. If the fix
26+
revealed a permanent lesson (a rule, a decision), promote it to `core/` or an
27+
ADR first. Mention this; do not delete now.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: minispec-feature
3+
description: Create a new MiniSpec feature document under .minispec/features/ from the feature template. Use when starting work on a feature, refactor, or migration that needs a short spec.
4+
---
5+
6+
# MiniSpec: new feature
7+
8+
Create a temporal feature document under `.minispec/features/`.
9+
10+
## Steps
11+
12+
1. Read `.minispec/README.md` to honor the standard (writing rules, formats).
13+
2. Read the template `.minispec/templates/feature.md`.
14+
3. Derive a kebab-case slug for the feature (e.g. `github-sync`). The file is
15+
`.minispec/features/<slug>.md`. If it already exists, update it instead of
16+
overwriting blindly.
17+
4. Fill the four sections (Goal / Context / Changes / Acceptance):
18+
- **Goal** — one sentence.
19+
- **Context** — current state: what exists, what's missing, why now.
20+
- **Changes** — short bullet list of the work.
21+
- **Acceptance** — observable done conditions.
22+
5. Base content on the real code and the user's description. Don't invent.
23+
24+
## Rules
25+
26+
- Max 100 lines. Short sentences and lists. No filler.
27+
- This is TEMPORAL knowledge: describe work in progress only.
28+
- Reminder for later: when the feature is done, promote anything permanent it
29+
revealed (a decision → ADR, a rule → conventions, a term → glossary) and then
30+
DELETE the feature file. Mention this to the user; do not delete now.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
name: minispec-implement
3+
description: List pending MiniSpec features (.minispec/features/) and implement the chosen one following the MiniSpec reading contract. Use when the user wants to turn a feature spec into code. Accepts an optional feature slug as argument.
4+
---
5+
6+
# MiniSpec: implement a feature
7+
8+
Turn a MiniSpec feature spec into code. MiniSpec is not a codegen pipeline: this
9+
skill just loads the right context and implements the feature like any task.
10+
11+
## Steps
12+
13+
### 1. Pick the feature
14+
15+
- The files in `.minispec/features/` are the **pending / in-progress** work
16+
(MiniSpec's temporal knowledge). Each `*.md` is a candidate; `fix-*.md` are
17+
bugfix notes.
18+
- If the user named a feature (argument or message), use that one. Match by slug
19+
(filename without `.md`); if ambiguous or not found, list and ask.
20+
- If no feature was named, **list the features** with a one-line summary of each
21+
(read each file's `# title` and `Goal`) and **ask the user which to
22+
implement**. Do not guess.
23+
- If `.minispec/features/` is empty, tell the user there's nothing pending and
24+
offer to create one with `/minispec-feature`.
25+
26+
### 2. Load context (reading contract)
27+
28+
Read `.minispec/README.md`, then follow its reading contract:
29+
30+
- Always: `core/project.md`, `core/conventions.md`, `core/principles.md`.
31+
- The chosen `features/<slug>.md`.
32+
- On demand only: `core/architecture.md`, `core/stack.md`, `core/glossary.md`,
33+
and any `decisions/ADR-*.md` the feature touches.
34+
35+
Do not read the whole `.minispec/` — only what the task needs.
36+
37+
### 3. Implement
38+
39+
- Write code that satisfies the feature's **Changes**, respecting
40+
`conventions.md` and `principles.md`.
41+
- Stay within scope: no refactors outside the feature (a principle).
42+
43+
### 4. Verify
44+
45+
- Check the result against the feature's **Acceptance** section, point by point.
46+
- Report what passes and what doesn't.
47+
48+
### 5. Close the feature (remind, don't auto-delete)
49+
50+
When the feature is done and verified, MiniSpec says to:
51+
52+
1. Promote anything **permanent** it revealed — a decision → ADR
53+
(`/minispec-adr`), a rule → `core/conventions.md`, a term → `core/glossary.md`.
54+
2. Then **delete** `features/<slug>.md`.
55+
56+
Tell the user this and offer to do it. Do not delete without confirmation.
57+
58+
## Rules
59+
60+
- Don't invent requirements not in the spec; if the spec is thin, ask before
61+
coding.
62+
- This skill chooses and implements; it does not rewrite the spec.

‎.minispec/README.md‎

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# MiniSpec v1.0
2+
3+
A lightweight specification standard for AI-assisted software development.
4+
5+
MiniSpec separates **permanent knowledge** (what the project *is*) from
6+
**temporal knowledge** (what is *being worked on*). The goal is to give an AI
7+
agent the minimum context it needs — and nothing more.
8+
9+
## Reading contract (for the agent)
10+
11+
**Always read first:**
12+
13+
- `core/project.md`
14+
- `core/conventions.md`
15+
- `core/principles.md`
16+
17+
**Read on demand:**
18+
19+
- Touching architecture → `core/architecture.md`
20+
- Unsure about the stack → `core/stack.md`
21+
- Domain terms → `core/glossary.md`
22+
- Working on a feature → the matching `features/*.md`
23+
- Structural decision → the relevant `decisions/ADR-*.md`
24+
25+
**Negative rule:** do not read anything you don't need for the task.
26+
27+
## Structure
28+
29+
```
30+
.minispec/
31+
├── README.md this file — the reading contract
32+
├── core/ PERMANENT knowledge (rarely changes)
33+
├── decisions/ ADRs — important decisions (permanent)
34+
├── features/ TEMPORAL knowledge — work in progress only
35+
└── templates/ templates for new documents
36+
```
37+
38+
## Writing rules
39+
40+
1. **Hard limit: 100 lines per document.** `project.md` ≤ 50, `principles.md` ≤ 20.
41+
2. Short sentences and lists. No filler prose.
42+
3. One document = one topic. Never mix permanent and temporal knowledge.
43+
4. Don't explain general technologies or concepts — only what is specific to
44+
this project.
45+
5. Don't duplicate what the code already says. Document the *why*, not the *how*.
46+
47+
## Document formats
48+
49+
- **Feature** — `Goal / Context / Changes / Acceptance`
50+
- **ADR** — `Decision / Motivation / Consequences`
51+
- **Bugfix** — `Problem / Cause / Solution / Verification`
52+
53+
## Naming
54+
55+
- Core: fixed names (`project.md`, `architecture.md`, `stack.md`,
56+
`conventions.md`, `glossary.md`, `principles.md`).
57+
- ADR: `ADR-NNN-slug.md`, sequential, never renumbered.
58+
- Feature / Bugfix: `slug.md` (kebab-case).
59+
60+
## Feature lifecycle
61+
62+
A feature file describes **work in progress only**. When a feature is done:
63+
64+
1. Promote anything **permanent** it revealed (a decision → ADR, a rule →
65+
`conventions.md`, a term → `glossary.md`).
66+
2. **Delete** the feature file.
67+
68+
If `features/` is empty, nothing is in flight.
69+
70+
## Maintenance
71+
72+
- Changing any rule in this standard bumps the version declared at the top.
73+
- Keep documents small. When in doubt, cut.

‎.minispec/core/architecture.md‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Architecture
2+
3+
## Flow
4+
5+
```
6+
PackageMojo (Maven) | PackagePlugin + PackageTask (Gradle)
7+
→ Context.setContext(MavenContext | GradleContext)
8+
→ PackagerFactory.createPackager(platform) + fluent settings
9+
→ packager.createApp() → packager.generateInstallers() → packager.createBundles()
10+
```
11+
12+
## Key pieces
13+
14+
- `packagers/Context` — static singleton hiding the build tool. Declares tool-specific operations (runnable JAR, copy dependencies, tarball, zipball, license, Launch4j EXE) and registers installer generators per platform.
15+
- `maven/MavenContext` — implements them by running other Maven plugins through `mojo-executor` (`maven/*` classes).
16+
- `gradle/GradleContext` — implements them with Gradle tasks (`gradle/*` classes with the same names).
17+
- `PackagerSettings` — every configuration property, with fluent setters. Also the base of the Gradle extension `PackagePluginExtension`.
18+
- `Packager` — shared pipeline: init, resolve resources/icons/license, app folder structure, bundle JRE, run installer generators. Subclasses `WindowsPackager`, `MacPackager`, `LinuxPackager` implement `doInit`, `doCreateAppStructure`, `doCreateApp`.
19+
- `ArtifactGenerator<T>` — unit of work: `skip(packager)` decides, `doApply(packager)` produces a `File`. Installers (`GenerateDeb`, `GenerateDmg`, `GenerateMsi`, ...), `BundleJre` and the Windows EXE creators are generators.
20+
- `utils/VelocityUtils` — renders `.vtl` templates, first from the user's `assetsDir`, then from the classpath. The packager is exposed as `$info` (plus `$StringUtils`, `$GUID`, `$features`).
21+
- `utils/CommandUtils` — runs external tools (`jlink`, `jdeps`, `iscc`, `candle`/`light`, `hdiutil`, `pkgbuild`, `codesign`, `rcedit`).
22+
- `utils/Logger` — wraps the Maven or Gradle logger, with indentation helpers.
23+
- `net/jsign/WindowsSigner` — Windows code signing on top of `jsign-core`.
24+
25+
## Windows launcher
26+
27+
`WindowsConfig.exeCreationTool` picks how the EXE is built: `launch4j` (via the context), `winrun4j` (`CreateWindowsExeWinRun4j`) or `why` (`CreateWindowsExeWhy`).
28+
29+
## WiX version
30+
31+
`GenerateMsm` detects the WiX major version (`wix -version`, falling back to `candle`/`light` as v3) and stores it in the packager. `GenerateMsi` relies on that, so MSM must stay registered before MSI in `Context`. v3 uses `candle` + `light`; v4+ uses `wix build`.
32+
33+
## Folder map
34+
35+
- `src/main/java/.../javapackager/maven/` — Maven mojo and Maven-based operations.
36+
- `src/main/java/.../javapackager/gradle/` — Gradle plugin, task, extension and Gradle-based operations.
37+
- `src/main/java/.../javapackager/packagers/` — build-tool-independent pipeline and generators.
38+
- `src/main/java/.../javapackager/model/` — configuration model (`WindowsConfig`, `MacConfig`, `LinuxConfig`, `FileAssociation`, ...).
39+
- `src/main/java/.../javapackager/utils/` — helpers (files, commands, Velocity, JDK, icons, XML).
40+
- `src/main/resources/{linux,mac,windows}/` — Velocity templates, default icons and bundled native binaries (WinRun4J, `JavaLauncher.exe`, `rcedit-x64.exe`, `nativeJavaApplicationStub*`, `universalJavaApplicationStub.sh`).
41+
- `docs/` — user documentation for platform-specific properties and samples.

‎.minispec/core/conventions.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Conventions
2+
3+
- Keep Java 8 compatibility: no APIs or syntax newer than Java 8.
4+
- Indent Java with tabs.
5+
- Build with the wrapper: `./gradlew build`. Test changes with `./gradlew publishToMavenLocal` and a real sample project; there are no unit tests.
6+
- Any change must keep working in both Maven and Gradle. Build-tool-specific code goes only in `maven/` or `gradle/`, behind `Context`.
7+
- A new configuration property is wired in: `PackagerSettings` (field + fluent setter + getter), `PackageMojo` (`@Parameter` + fluent call in `execute()`), `PackageTask` (annotated field + fluent call in `createPackager()` with `defaultIfNull(taskValue, extension.getX())`), and documented in `README.md` or `docs/*-specific-properties.md`.
8+
- Platform-specific options go in `WindowsConfig`, `MacConfig` or `LinuxConfig`, not in `PackagerSettings`.
9+
- New artifacts are `ArtifactGenerator` subclasses. Platform and external-tool checks go in `skip()`, not in `doApply()`.
10+
- Template names and the variables they use are public API: users override them from `assetsDir`. Renaming a template or changing its variables is a breaking change.
11+
- Log through `utils/Logger`, never `System.out`.
12+
- Run external tools through `utils/CommandUtils`.
13+
- Bundled native binaries in `src/main/resources` are not edited by hand. `updateWhyJavaLauncher` refreshes `JavaLauncher.exe`; `updateUniversalJavaApplicationStub` only matters for `universalJavaApplicationStub.sh`.
14+
- A fix is verified by packaging on the affected OS; record how in the bugfix note.

‎.minispec/core/glossary.md‎

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Glossary
2+
3+
## App folder
4+
5+
The generated directory `${outputDirectory}/${name}` with the native app: launcher, JAR, `libs`, JRE and resources. Installers and bundles are built from it.
6+
7+
## Assets dir
8+
9+
`assetsDir` (default `assets/` in the project). Holds user icons and templates organized by platform (`linux/`, `mac/`, `windows/`) that replace the plugin defaults with the same name.
10+
11+
## Bootstrap script
12+
13+
Optional user script (`scripts.bootstrap`) run by the startup script before launching the app.
14+
15+
## Bundle
16+
17+
Zipball or tarball of the app folder (`createZipball`, `createTarball`).
18+
19+
## Context
20+
21+
The build-tool abstraction (`MavenContext` or `GradleContext`), held statically in `Context`.
22+
23+
## Customized JRE
24+
25+
JRE generated with `jlink`, containing only the modules found by `jdeps` or listed in `modules`.
26+
27+
## EXE creation tool
28+
29+
How the Windows launcher is built: `launch4j`, `winrun4j` or `why`.
30+
31+
## Generator
32+
33+
An `ArtifactGenerator`: a step that may be skipped and produces one file (installer, JRE, EXE).
34+
35+
## Installer
36+
37+
A platform package built from the app folder: DEB, RPM, AppImage, DMG, PKG, Inno Setup EXE (setup), MSI, MSM.
38+
39+
## Packager
40+
41+
The platform-specific orchestrator (`WindowsPackager`, `MacPackager`, `LinuxPackager`).
42+
43+
## Platform
44+
45+
Target OS: `auto`, `linux`, `mac` or `windows`. May differ from the OS running the build.
46+
47+
## Runnable JAR
48+
49+
The app JAR with a manifest pointing to `mainClass`, created by the plugin unless `runnableJar` is given.
50+
51+
## Mac startup
52+
53+
macOS launcher type (`macStartup`): `UNIVERSAL`, `X86_64`, `ARM64` (bundled `nativeJavaApplicationStub` binaries) or `SCRIPT` (`universalJavaApplicationStub.sh`). The launcher is always copied into the app as `Contents/MacOS/universalJavaApplicationStub`.

‎.minispec/core/principles.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Engineering principles
2+
3+
Consult **before** writing code.
4+
5+
- Solve first, optimize later.
6+
- Readable code over clever code.
7+
- One responsibility per class or component.
8+
- Prefer composition over inheritance.
9+
- Avoid premature abstractions.
10+
- Preserve existing behavior: users' existing Maven/Gradle configurations and custom templates must keep working.
11+
- Don't refactor outside the task's scope.
12+
- If a choice adds a lot of complexity, propose a simpler alternative first.
13+
- Document decisions, not implementation.

‎.minispec/core/project.md‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Project
2+
3+
## What
4+
5+
JavaPackager is a hybrid Maven/Gradle plugin, published as a single artifact (`io.github.fvarrui:javapackager`), that packages Java applications as native Windows, macOS or GNU/Linux apps and generates installers for them.
6+
7+
## What it does
8+
9+
- Builds a native app folder: runnable JAR, dependencies, launcher executable or startup script, icons and optional bundled JRE.
10+
- Generates a customized JRE with `jdeps` + `jlink`, or bundles an existing one.
11+
- Generates installers: DEB, RPM and AppImage (Linux); DMG and PKG (macOS); Inno Setup EXE, MSI and MSM (Windows).
12+
- Creates zipball/tarball bundles of the app folder.
13+
- Lets users override any icon or Velocity template from their own `assetsDir`.
14+
15+
## For whom
16+
17+
- Java developers who want to distribute desktop apps without chaining several plugins.
18+
- Users configure it through `pom.xml` (goal `package`) or a Gradle `PackageTask`; see `README.md` and `docs/`.
19+
20+
## Goal
21+
22+
One plugin to rule them all: package and distribute a Java app natively from a single build configuration.

0 commit comments

Comments
 (0)