@codyswann/lisa 2.116.2 → 2.118.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/codex/hooks-installer.js +60 -16
  2. package/dist/codex/hooks-installer.js.map +1 -1
  3. package/dist/codex/scripts/inject-rules.sh +14 -2
  4. package/package.json +3 -2
  5. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  6. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  7. package/plugins/lisa/hooks/inject-rules.sh +14 -3
  8. package/plugins/lisa/rules/eager/base-rules.md +70 -0
  9. package/plugins/lisa/rules/eager/coding-philosophy.md +27 -0
  10. package/plugins/lisa/rules/eager/config-resolution.md +28 -0
  11. package/plugins/lisa/rules/eager/documentation-source-paths.md +13 -0
  12. package/plugins/lisa/rules/eager/empirical-inquiry.md +22 -0
  13. package/plugins/lisa/rules/eager/intent-routing.md +18 -0
  14. package/plugins/lisa/rules/eager/leaf-only-lifecycle.md +39 -0
  15. package/plugins/lisa/rules/eager/prd-lifecycle-rollup.md +31 -0
  16. package/plugins/lisa/rules/eager/repo-scope-split.md +39 -0
  17. package/plugins/lisa/rules/eager/security-audit-handling.md +29 -0
  18. package/plugins/lisa/rules/eager/usage-accounting.md +28 -0
  19. package/plugins/lisa/rules/eager/verification.md +21 -0
  20. package/plugins/lisa/rules/eager/wiki-knowledge-source.md +16 -0
  21. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  22. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  23. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  24. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  25. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  26. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  27. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  28. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  29. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  30. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  31. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  32. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  33. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  34. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  35. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  36. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  37. package/plugins/lisa-wiki/scripts/ensure-gitignore.mjs +131 -0
  38. package/plugins/lisa-wiki/skills/lisa-wiki-setup/SKILL.md +13 -4
  39. package/plugins/lisa-wiki/templates/wrapper-gitignore.txt +19 -0
  40. package/plugins/src/base/hooks/inject-rules.sh +14 -3
  41. package/plugins/src/base/rules/eager/base-rules.md +70 -0
  42. package/plugins/src/base/rules/eager/coding-philosophy.md +27 -0
  43. package/plugins/src/base/rules/eager/config-resolution.md +28 -0
  44. package/plugins/src/base/rules/eager/documentation-source-paths.md +13 -0
  45. package/plugins/src/base/rules/eager/empirical-inquiry.md +22 -0
  46. package/plugins/src/base/rules/eager/intent-routing.md +18 -0
  47. package/plugins/src/base/rules/eager/leaf-only-lifecycle.md +39 -0
  48. package/plugins/src/base/rules/eager/prd-lifecycle-rollup.md +31 -0
  49. package/plugins/src/base/rules/eager/repo-scope-split.md +39 -0
  50. package/plugins/src/base/rules/eager/security-audit-handling.md +29 -0
  51. package/plugins/src/base/rules/eager/usage-accounting.md +28 -0
  52. package/plugins/src/base/rules/eager/verification.md +21 -0
  53. package/plugins/src/base/rules/eager/wiki-knowledge-source.md +16 -0
  54. package/plugins/src/wiki/scripts/ensure-gitignore.mjs +131 -0
  55. package/plugins/src/wiki/skills/lisa-wiki-setup/SKILL.md +13 -4
  56. package/plugins/src/wiki/templates/wrapper-gitignore.txt +19 -0
  57. package/scripts/check-rules-pairing.sh +91 -0
  58. /package/plugins/lisa/rules/{base-rules.md → reference/base-rules.md} +0 -0
  59. /package/plugins/lisa/rules/{coding-philosophy.md → reference/coding-philosophy.md} +0 -0
  60. /package/plugins/lisa/rules/{config-resolution.md → reference/config-resolution.md} +0 -0
  61. /package/plugins/lisa/rules/{documentation-source-paths.md → reference/documentation-source-paths.md} +0 -0
  62. /package/plugins/lisa/rules/{empirical-inquiry.md → reference/empirical-inquiry.md} +0 -0
  63. /package/plugins/lisa/rules/{intent-routing.md → reference/intent-routing.md} +0 -0
  64. /package/plugins/lisa/rules/{leaf-only-lifecycle.md → reference/leaf-only-lifecycle.md} +0 -0
  65. /package/plugins/lisa/rules/{prd-lifecycle-rollup.md → reference/prd-lifecycle-rollup.md} +0 -0
  66. /package/plugins/lisa/rules/{repo-scope-split.md → reference/repo-scope-split.md} +0 -0
  67. /package/plugins/lisa/rules/{security-audit-handling.md → reference/security-audit-handling.md} +0 -0
  68. /package/plugins/lisa/rules/{usage-accounting.md → reference/usage-accounting.md} +0 -0
  69. /package/plugins/lisa/rules/{verification.md → reference/verification.md} +0 -0
  70. /package/plugins/lisa/rules/{wiki-knowledge-source.md → reference/wiki-knowledge-source.md} +0 -0
  71. /package/plugins/src/base/rules/{base-rules.md → reference/base-rules.md} +0 -0
  72. /package/plugins/src/base/rules/{coding-philosophy.md → reference/coding-philosophy.md} +0 -0
  73. /package/plugins/src/base/rules/{config-resolution.md → reference/config-resolution.md} +0 -0
  74. /package/plugins/src/base/rules/{documentation-source-paths.md → reference/documentation-source-paths.md} +0 -0
  75. /package/plugins/src/base/rules/{empirical-inquiry.md → reference/empirical-inquiry.md} +0 -0
  76. /package/plugins/src/base/rules/{intent-routing.md → reference/intent-routing.md} +0 -0
  77. /package/plugins/src/base/rules/{leaf-only-lifecycle.md → reference/leaf-only-lifecycle.md} +0 -0
  78. /package/plugins/src/base/rules/{prd-lifecycle-rollup.md → reference/prd-lifecycle-rollup.md} +0 -0
  79. /package/plugins/src/base/rules/{repo-scope-split.md → reference/repo-scope-split.md} +0 -0
  80. /package/plugins/src/base/rules/{security-audit-handling.md → reference/security-audit-handling.md} +0 -0
  81. /package/plugins/src/base/rules/{usage-accounting.md → reference/usage-accounting.md} +0 -0
  82. /package/plugins/src/base/rules/{verification.md → reference/verification.md} +0 -0
  83. /package/plugins/src/base/rules/{wiki-knowledge-source.md → reference/wiki-knowledge-source.md} +0 -0
@@ -0,0 +1,16 @@
1
+ # Wiki as Knowledge Source (load-bearing)
2
+
3
+ If the project has an LLM Wiki (a `wiki/` directory with `index.md`), treat it as the canonical source of durable project knowledge.
4
+
5
+ Before researching background, conventions, ownership, architecture, glossary, or "how/why does X work here":
6
+
7
+ 1. **Consult the wiki first.** Start from `wiki/index.md` or use the wiki query skill (`/lisa-wiki-query`).
8
+ 2. **Use what the wiki says** as the authoritative answer when it covers the question — do not re-derive it from raw sources.
9
+ 3. **Fall back to primary sources** (code, tickets, commit history, external docs) only when the wiki is silent, ambiguous, or contradicted by what you observe.
10
+ 4. **Surface gaps.** If the wiki is wrong, stale, or missing knowledge that belongs there, flag it — and where the workflow supports it, capture the correction via `/lisa-wiki-ingest`.
11
+
12
+ The wiki documents knowledge; it does NOT override executable behavior. When wiki and running code disagree about what the system does, trust the code and treat the wiki as out of date.
13
+
14
+ If the project has no `wiki/`, this rule does not apply.
15
+
16
+ Full prose: [reference/wiki-knowledge-source.md](../reference/wiki-knowledge-source.md).
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "2.116.2",
3
+ "version": "2.118.0",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "2.116.2",
3
+ "version": "2.118.0",
4
4
  "description": "AWS CDK-specific Lisa plugin.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-expo",
3
- "version": "2.116.2",
3
+ "version": "2.118.0",
4
4
  "description": "Expo/React Native-specific skills, agents, rules, and MCP servers",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-expo",
3
- "version": "2.116.2",
3
+ "version": "2.118.0",
4
4
  "description": "Expo and React Native-specific skills, agents, rules, and MCP servers.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-harper-fabric",
3
- "version": "2.116.2",
3
+ "version": "2.118.0",
4
4
  "description": "Harper/Fabric-specific rules for TypeScript component apps",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-harper-fabric",
3
- "version": "2.116.2",
3
+ "version": "2.118.0",
4
4
  "description": "Harper/Fabric-specific Lisa rules for TypeScript component apps.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "2.116.2",
3
+ "version": "2.118.0",
4
4
  "description": "NestJS-specific skills (GraphQL, TypeORM) and hooks (migration write-protection)",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "2.116.2",
3
+ "version": "2.118.0",
4
4
  "description": "NestJS-specific skills and migration write-protection hooks.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-openclaw",
3
- "version": "2.116.2",
3
+ "version": "2.118.0",
4
4
  "description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-openclaw",
3
- "version": "2.116.2",
3
+ "version": "2.118.0",
4
4
  "description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, across Claude and Codex.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "2.116.2",
3
+ "version": "2.118.0",
4
4
  "description": "Ruby on Rails-specific hooks — RuboCop linting/formatting and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "2.116.2",
3
+ "version": "2.118.0",
4
4
  "description": "Ruby on Rails-specific skills and hooks for RuboCop and ast-grep scanning on edit.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "2.116.2",
3
+ "version": "2.118.0",
4
4
  "description": "TypeScript-specific hooks — Prettier formatting, ESLint linting, ast-grep scanning, and error-suppression blocking on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "2.116.2",
3
+ "version": "2.118.0",
4
4
  "description": "TypeScript-specific hooks for formatting, linting, and ast-grep scanning on edit.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-wiki",
3
- "version": "2.116.2",
3
+ "version": "2.118.0",
4
4
  "description": "LLM Wiki — a distributable, git-native markdown knowledge base for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-wiki",
3
- "version": "2.116.2",
3
+ "version": "2.118.0",
4
4
  "description": "Distributable LLM Wiki kernel — ingest, query, lint, and maintain a git-native markdown knowledge base across Claude and Codex.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -0,0 +1,131 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * ensure-gitignore.mjs — merge the lisa-wiki gitignore block into the project's
4
+ * `.gitignore`, idempotently. Dependency-free.
5
+ *
6
+ * The block is delimited by `# BEGIN: AI GUARDRAILS WIKI` and
7
+ * `# END: AI GUARDRAILS WIKI` markers (see templates/wrapper-gitignore.txt).
8
+ * Behavior matches the base lisa plugin's copy-contents strategy
9
+ * (src/strategies/copy-contents.ts):
10
+ *
11
+ * - If the file is missing, create it with just the block.
12
+ * - If the block markers exist, replace the block in place.
13
+ * - If the markers don't exist, append the block to the end (preserving a
14
+ * trailing newline).
15
+ *
16
+ * Patterns outside the marker block are NEVER touched. Re-running produces no
17
+ * spurious diff once the file is in sync.
18
+ *
19
+ * Usage: node ensure-gitignore.mjs [--cwd <project-dir>] [--dry-run]
20
+ * default cwd: process.cwd()
21
+ * --dry-run prints the proposed merge result to stdout instead of writing
22
+ *
23
+ * Exit code 0 = ok (file was created, updated, or already in sync).
24
+ * Exit code 1 = error (e.g. template missing).
25
+ */
26
+ import fs from "node:fs";
27
+ import path from "node:path";
28
+ import { fileURLToPath } from "node:url";
29
+
30
+ const BEGIN_MARKER = "# BEGIN: AI GUARDRAILS WIKI";
31
+ const END_MARKER = "# END: AI GUARDRAILS WIKI";
32
+
33
+ function fail(msg) {
34
+ console.error(`✗ ${msg}`);
35
+ process.exit(1);
36
+ }
37
+
38
+ const scriptDir = path.dirname(fileURLToPath(import.meta.url));
39
+ const pluginRoot = path.dirname(scriptDir);
40
+ const templatePath = path.join(
41
+ pluginRoot,
42
+ "templates",
43
+ "wrapper-gitignore.txt"
44
+ );
45
+
46
+ const argv = process.argv.slice(2);
47
+ const cwdIndex = argv.indexOf("--cwd");
48
+ const projectDir =
49
+ cwdIndex !== -1 && argv[cwdIndex + 1]
50
+ ? path.resolve(argv[cwdIndex + 1])
51
+ : process.cwd();
52
+ const dryRun = argv.includes("--dry-run");
53
+
54
+ if (!fs.existsSync(templatePath)) {
55
+ fail(`template not found: ${templatePath}`);
56
+ }
57
+
58
+ const templateRaw = fs.readFileSync(templatePath, "utf8");
59
+ const block = extractBlock(templateRaw);
60
+ if (!block) {
61
+ fail(
62
+ `template at ${templatePath} does not contain the expected marker pair (${BEGIN_MARKER} / ${END_MARKER})`
63
+ );
64
+ }
65
+
66
+ const gitignorePath = path.join(projectDir, ".gitignore");
67
+ const existing = fs.existsSync(gitignorePath)
68
+ ? fs.readFileSync(gitignorePath, "utf8")
69
+ : null;
70
+
71
+ const merged = mergeBlock(existing, block);
72
+
73
+ if (existing !== null && merged === existing) {
74
+ console.log(`✓ .gitignore already in sync (${gitignorePath})`);
75
+ process.exit(0);
76
+ }
77
+
78
+ if (dryRun) {
79
+ process.stdout.write(merged);
80
+ process.exit(0);
81
+ }
82
+
83
+ fs.writeFileSync(gitignorePath, merged);
84
+ const verb = existing === null ? "created" : "updated";
85
+ console.log(`✓ ${verb} ${gitignorePath}`);
86
+ process.exit(0);
87
+
88
+ /**
89
+ * Pull the block (markers included) out of arbitrary text. Returns null when
90
+ * the marker pair is missing or out of order.
91
+ */
92
+ function extractBlock(text) {
93
+ const startIdx = text.indexOf(BEGIN_MARKER);
94
+ if (startIdx === -1) return null;
95
+ const endStart = text.indexOf(END_MARKER, startIdx + BEGIN_MARKER.length);
96
+ if (endStart === -1) return null;
97
+ const endIdx = endStart + END_MARKER.length;
98
+ return text.slice(startIdx, endIdx);
99
+ }
100
+
101
+ /**
102
+ * Merge a freshly-rendered block into the destination file content.
103
+ * - existing === null → return the block alone (file will be created)
104
+ * - existing has the markers → replace the block in place
105
+ * - existing lacks the markers → append the block at the end
106
+ * Always normalizes to exactly one trailing newline.
107
+ */
108
+ function mergeBlock(existing, freshBlock) {
109
+ if (existing === null) {
110
+ return `${freshBlock.trimEnd()}\n`;
111
+ }
112
+
113
+ const startIdx = existing.indexOf(BEGIN_MARKER);
114
+ if (startIdx !== -1) {
115
+ const endStart = existing.indexOf(
116
+ END_MARKER,
117
+ startIdx + BEGIN_MARKER.length
118
+ );
119
+ if (endStart !== -1) {
120
+ const endIdx = endStart + END_MARKER.length;
121
+ const before = existing.slice(0, startIdx);
122
+ const after = existing.slice(endIdx);
123
+ const trimmedAfter = after.startsWith("\n") ? after : `\n${after}`;
124
+ return `${before}${freshBlock.trimEnd()}${trimmedAfter}`;
125
+ }
126
+ }
127
+
128
+ // No marker pair in the destination — append.
129
+ const base = existing.endsWith("\n") ? existing : `${existing}\n`;
130
+ return `${base}\n${freshBlock.trimEnd()}\n`;
131
+ }
@@ -30,13 +30,22 @@ never overwrites human-authored content.
30
30
  3. **Contract.** Render `wiki/schema/llm-wiki-contract.md` from the plugin templates + config via
31
31
  `scripts/render-contract.mjs`, stamping the `kernelVersion`. This snapshot keeps the wiki
32
32
  self-describing without the plugin installed.
33
- 4. **Pointers.** Ensure `AGENTS.md` / `CLAUDE.md` point at the contract + plugin (thin pointers only).
34
- 5. **Staff.** For each `config.staff[]` entry (the standard roster by default), generate the role's
33
+ 4. **Gitignore.** Merge the lisa-wiki gitignore block into the project's `.gitignore` via
34
+ `scripts/ensure-gitignore.mjs`. The block (delimited by `# BEGIN: AI GUARDRAILS WIKI` /
35
+ `# END: AI GUARDRAILS WIKI`) covers transient per-session worktrees and Lisa backup snapshots
36
+ (`.claude/worktrees/`, `.codex/worktrees/`, `.lisabak/`). Idempotent: re-running produces no
37
+ diff once the block is present. The block coexists with the base lisa plugin's
38
+ `# BEGIN: AI GUARDRAILS` block — both can be installed without overwriting each other because
39
+ the copy-contents strategy keys on the marker suffix. Wiki-wrapper repos (mode `wrapper` /
40
+ `standalone`) typically don't enable the base lisa plugin, so this step is the only path by
41
+ which they get the worktree-ignore patterns.
42
+ 5. **Pointers.** Ensure `AGENTS.md` / `CLAUDE.md` point at the contract + plugin (thin pointers only).
43
+ 6. **Staff.** For each `config.staff[]` entry (the standard roster by default), generate the role's
35
44
  `wiki/staff/<role>.md` page and its dual-runtime subagents by delegating to `lisa-wiki-add-role`
36
45
  (running the subagents is out of scope).
37
- 6. **README.** Apply the chosen README mode (ingest the old README first; `rich` keeps install/usage +
46
+ 7. **README.** Apply the chosen README mode (ingest the old README first; `rich` keeps install/usage +
38
47
  adds the onboarding line; `stub` is the minimal pointer; `preserve` leaves it).
39
- 7. **Verify.** Run `lisa-wiki-doctor` and report the verdict + any blocking items.
48
+ 8. **Verify.** Run `lisa-wiki-doctor` and report the verdict + any blocking items.
40
49
 
41
50
  ## Standard roster
42
51
  The default operating team seeded into `config.staff[]` for every new wiki (Chief of Staff plus six
@@ -0,0 +1,19 @@
1
+ # BEGIN: AI GUARDRAILS WIKI
2
+ # Managed by the lisa-wiki kernel. Do not edit between these markers — re-run
3
+ # /lisa-wiki:setup (or the equivalent script) to update. Patterns outside the
4
+ # block are preserved untouched. The "WIKI" suffix lets this block coexist
5
+ # with the base lisa plugin's "# BEGIN: AI GUARDRAILS" block when both are
6
+ # installed (the copy-contents strategy keys on the marker suffix).
7
+
8
+ # Claude Code per-session git worktrees. Each Claude session that needs an
9
+ # isolated working copy spawns one under .claude/worktrees/ (via
10
+ # `git worktree add`). They are transient, large (often hundreds of MB each),
11
+ # and per-developer; they must never be committed.
12
+ /.claude/worktrees/
13
+
14
+ # Codex CLI per-session worktrees (Codex equivalent of the above).
15
+ /.codex/worktrees/
16
+
17
+ # Lisa backup snapshots (created by `lisa` runs).
18
+ /.lisabak/
19
+ # END: AI GUARDRAILS WIKI
@@ -1,12 +1,23 @@
1
1
  #!/usr/bin/env bash
2
- # Reads all .md files from the plugin's rules/ directory and injects them
2
+ # Reads all .md files from the plugin's rules/eager/ directory and injects them
3
3
  # into the session context via additionalContext.
4
4
  # Used by SessionStart and SubagentStart hooks.
5
+ #
6
+ # The split between eager and reference rules is documented in
7
+ # rules/eager/00-bootstrap.md (or the equivalent README). Reference bodies
8
+ # under rules/reference/ are installed alongside but loaded only when the
9
+ # eager breadcrumb points to them.
5
10
  set -euo pipefail
6
11
 
7
- RULES_DIR="${CLAUDE_PLUGIN_ROOT}/rules"
12
+ RULES_DIR="${CLAUDE_PLUGIN_ROOT}/rules/eager"
8
13
 
9
- # Bail silently if no rules directory
14
+ # Backward compatibility: if the eager subdir is absent (older Lisa install),
15
+ # fall back to the flat rules/ directory so a partial upgrade still ships rules.
16
+ if [ ! -d "$RULES_DIR" ]; then
17
+ RULES_DIR="${CLAUDE_PLUGIN_ROOT}/rules"
18
+ fi
19
+
20
+ # Bail silently if no rules directory at all
10
21
  [ -d "$RULES_DIR" ] || exit 0
11
22
 
12
23
  CONTEXT=""
@@ -0,0 +1,70 @@
1
+ # Base Rules (load-bearing)
2
+
3
+ These are mandatory disciplines that apply to every session. Full prose, JIRA dev-status query, ADF templates, etc. live in [reference/base-rules.md](../reference/base-rules.md).
4
+
5
+ ## Requirement Verification
6
+
7
+ Treat every request as potentially underspecified. Before starting any work:
8
+
9
+ 1. Identify ambiguities that would prevent completion. If any exist, stop and ask.
10
+ 2. Identify open questions whose answers would change your approach. If any exist, stop and ask.
11
+ 3. Define how you will empirically verify the work is complete by USING the resulting software, not just running tests. If you cannot define this, stop and ask.
12
+ 4. If a request contradicts existing code/architecture/conventions, raise the contradiction and confirm intent before proceeding.
13
+
14
+ Do not begin work if there are blockers, ambiguities, access requirements, or unanswered questions. Identify these before starting, not during implementation.
15
+
16
+ ## Code Quality
17
+
18
+ - Atomic commits with conventional commit messages.
19
+ - Document the **why**, not the what.
20
+ - Add new imports and their first usage in the same edit (the lint-on-edit hook strips unused imports).
21
+ - Delete old code completely when replacing it. No deprecation comments unless asked.
22
+ - Fix bugs at root cause. Never work around them or assume a failure is "pre-existing."
23
+ - Test empirically. Never assume test expectations before observing actual behavior.
24
+
25
+ ## Git Discipline
26
+
27
+ - **Never use `--no-verify`** or bypass any git hook.
28
+ - **Never bypass branch protection** — no `--admin`, `--force`, no merging a PR with failing CI. "Green in CI" is the definition of done.
29
+ - Never commit directly to environment branches (`dev`, `staging`, `main`).
30
+ - Prefix `git push` with `GIT_SSH_COMMAND="ssh -o ServerAliveInterval=30 -o ServerAliveCountMax=5"`.
31
+ - When opening a PR, watch it. Fix every failing check and every valid bot review comment. Resolve threads. Loop until merged.
32
+ - After merging into an environment branch, watch the deploy. If it fails, fix it and open a new PR.
33
+ - **Promotion PRs** (env→env) MUST use `gh pr merge --merge` (regular merge commit), NEVER squash. Squashing strips `[skip ci]` markers and breaks promotion detection. Feature PRs also use `--merge`.
34
+ - Always include the PR URL when referencing a PR.
35
+
36
+ ## Testing Discipline
37
+
38
+ - Never skip or disable tests. Never add skip directives without explicit instruction.
39
+ - Never lower coverage thresholds to pass a hook — raise coverage instead.
40
+
41
+ ## JIRA Discipline
42
+
43
+ - Read **all** comments on a ticket, not just the description.
44
+ - When clarifying, comment via ADF and @mention the Reporter.
45
+ - Establish issue link relationships (`blocks`, `is blocked by`, `relates to`) — search git history AND Jira before declaring "no related work."
46
+ - Single-repo invariant: Bug/Task/Sub-task MUST be single-repo. Epic/Story/Spike MAY span repos. Cross-repo leaves are split per the `repo-scope-split` rule.
47
+ - Pre-flight gate: BLOCK + reassign-to-Reporter if a ticket is missing target backend env, sign-in credentials, Gherkin acceptance criteria, epic parent (non-bug/non-epic), or relationship discovery evidence.
48
+
49
+ ## Pace
50
+
51
+ Never rush. A fast wrong answer is worse than a slow correct one. Surface difficulty to the user instead of compressing the work.
52
+
53
+ ## NEVER
54
+
55
+ - Modify this file directly.
56
+ - Touch files inside `node_modules`, `.venv`, `vendor`, `target`.
57
+ - Delete anything untracked, or anything outside this project.
58
+ - Create placeholders, TODOs, versioned copies (`V2`, `processNew`, `handleOld`).
59
+ - Write migration code unless explicitly requested.
60
+ - Update CHANGELOG yourself.
61
+
62
+ ## ASK FIRST
63
+
64
+ - Before adding a lint/formatter suppression (`eslint-disable`, `biome-ignore`, `noqa`, etc.).
65
+ - Before adding a type-check suppression (`ts-ignore`, `ts-expect-error`, `# type: ignore`).
66
+ - Lint suppression in test files is OK without asking only when comprehensive coverage genuinely requires it.
67
+
68
+ ## Multi-Repository Awareness
69
+
70
+ If you see imports that don't resolve, API calls without a contract, shared libs not present, env vars naming foreign services, stack traces pointing out-of-repo, or ticket references to other components — stop guessing. Identify the repo, add it to the session, or ask.
@@ -0,0 +1,27 @@
1
+ # Coding Philosophy (load-bearing)
2
+
3
+ When writing or modifying code, follow these principles. Examples, hook structure templates, and anti-pattern catalogs live in [reference/coding-philosophy.md](../reference/coding-philosophy.md).
4
+
5
+ ## Principle priority
6
+
7
+ **KISS is the tiebreaker.** When principles conflict, choose the simpler solution.
8
+
9
+ 1. **YAGNI** — Don't build features, abstractions, or flexibility you don't need right now. Solve today's problem.
10
+ 2. **KISS** — Choose the simpler option.
11
+ 3. **DRY** — Extract only when (a) the same logic appears 3+ times, (b) the abstraction is simpler than the duplication, and (c) the extracted code has a clear single purpose.
12
+ 4. **SOLID** — Apply pragmatically. Split a function only when it does 2+ unrelated things AND splitting reduces complexity. Use composition over inheritance.
13
+
14
+ ## Mandatory practices
15
+
16
+ - **Immutability first.** Never mutate. Spread/clone to create new references.
17
+ - **TDD is mandatory.** Write the failing test BEFORE the implementation. Red → Green → Refactor.
18
+ - **Function structure order**: (1) variables & derived state, (2) side effects, (3) return. Never interleave.
19
+ - **Functional transformations.** Prefer `map`/`filter`/`reduce` over imperative loops with mutation.
20
+ - **Clean deletion.** When replacing code, delete the old version completely. No `V2`/`Old`/`New` suffixes, no `@deprecated` comments, no migration shims unless explicitly requested. Trust git history.
21
+
22
+ ## What NOT to write
23
+
24
+ - Comments that explain WHAT the code does (well-named identifiers do that).
25
+ - Error handling, fallbacks, or validation for scenarios that can't happen.
26
+ - Backwards-compatibility shims, feature flags, or unused `_var` renames when you can just change the code.
27
+ - Half-finished implementations, placeholders, or TODOs.
@@ -0,0 +1,28 @@
1
+ # Config Resolution (load-bearing)
2
+
3
+ Lisa configuration lives in `.lisa.config.json` (committed) and `.lisa.config.local.json` (gitignored, per-developer). The local file wins where they overlap. Developer-specific identity (`atlassian.email`, etc.) MUST live in the local file, never committed.
4
+
5
+ ## Atlassian access — assistant-level rule
6
+
7
+ When the user asks about Atlassian (Jira / Confluence) connection state, or you are about to run a Jira/Confluence operation, and `acli` is installed:
8
+
9
+ 1. Run `acli auth status` and read the active `Site:`.
10
+ 2. Read `atlassian.site` from `.lisa.config.json` (and `atlassian.email` from `.lisa.config.local.json` if present).
11
+ 3. **If the active site does not match config, do NOT report "not connected." Run:**
12
+ ```sh
13
+ acli auth switch --site "$ATLASSIAN_SITE" --email "$ATLASSIAN_EMAIL"
14
+ ```
15
+ acli supports multiple authenticated profiles; the switch is fast and non-interactive when a profile already exists.
16
+ 4. Only after the switch fails (no matching profile) should you report not-connected and suggest `/lisa:setup:atlassian` to add one.
17
+
18
+ This applies before declaring connection state, before running any `acli jira *` / `acli confluence *` command, and before falling back to the Atlassian MCP or curl substrates. Identity mismatch is treated as silent-misroute risk, not as a hard not-connected.
19
+
20
+ ## Tracker selection
21
+
22
+ Project tracker (`jira` / `github` / `linear`) is read from `.lisa.config.json` `tracker`. Vendor-neutral skills MUST dispatch through the configured tracker, never infer it from arguments. Missing `tracker` → stop and instruct the user to run the matching `/lisa:setup:*` skill.
23
+
24
+ ## Repo identity
25
+
26
+ `repo:<name>` is the canonical label for which repo a work item belongs to. Resolve current-repo identity in this priority order: `.lisa.config.local.json` `repo` → `.lisa.config.json` `repo` → `.lisa.config.json` `github.repo` → `basename -s .git "$(git remote get-url origin)"`. If none resolve, stop with a clear error.
27
+
28
+ Full reference: [reference/config-resolution.md](../reference/config-resolution.md).
@@ -0,0 +1,13 @@
1
+ # Documentation Source Paths (load-bearing)
2
+
3
+ Do not treat `docs/`, `research/`, `transcripts/`, or other source-material directories as disposable duplicates just because a project also has a `wiki/`. They may be ingestion inputs, executable fixtures, runtime inputs, or historical evidence.
4
+
5
+ Before moving, absorbing, or deleting documentation-like paths:
6
+
7
+ 1. Classify each path: durable wiki content, reader-safe source note, executable test fixture, runtime scratch/input, generated output, or obsolete.
8
+ 2. Use `rg` to find every code, test, script, config, README, rule, skill, agent, and wiki reference to the path.
9
+ 3. Preserve executable fixtures and runtime inputs OUTSIDE the wiki — they are project behavior, not documentation.
10
+ 4. When absorbing into `wiki/`, update source notes, indexes, logs, README links, rule references, and runtime defaults that pointed at the old path.
11
+ 5. Delete a path only AFTER references are updated and verification proves the project no longer reads it.
12
+
13
+ Full context (Lisa-wiki specifics, `wiki/sources/` evidence layout): [reference/documentation-source-paths.md](../reference/documentation-source-paths.md).
@@ -0,0 +1,22 @@
1
+ # Empirical Inquiry — Test, Don't Guess (load-bearing)
2
+
3
+ When a decision depends on a fact you are not certain of — how a tool, API, harness, runtime, or dependency actually behaves — **find out empirically before you act.** Run the smallest experiment that settles the question, observe the real result, and proceed from what you observed.
4
+
5
+ Do not reason your way to a confident-sounding answer from documentation, prior assumption, or training knowledge when the real system is right there and a quick probe would tell you the truth.
6
+
7
+ ## How to apply
8
+
9
+ 1. **State the uncertain fact** explicitly, so you know what the experiment must resolve.
10
+ 2. **Run the cheapest probe** that produces real evidence — a single command, a one-shot subagent, a tiny script, a direct API call against a scratch input.
11
+ 3. **Report the raw result** (verbatim output or error), then your conclusion. Distinguish observation from inference.
12
+ 4. **Encode the verified fact**, and when non-obvious or contradicting docs, record WHY so the next agent inherits the finding.
13
+
14
+ ## Forbidden
15
+
16
+ - Presenting a guess, recollection, or doc summary as established fact when it was cheap to verify and you did not.
17
+ - "Should work" / "probably" / "the docs say" as the basis for a load-bearing decision an experiment could have settled.
18
+ - Skipping the probe because the answer "seems obvious" — those are exactly the ones that quietly drift from reality.
19
+
20
+ This is the inquiry counterpart to the `verification` rule (which proves completed work behaves correctly). Both reject "it looks correct" as evidence.
21
+
22
+ Full prose: [reference/empirical-inquiry.md](../reference/empirical-inquiry.md).
@@ -0,0 +1,18 @@
1
+ # Intent Routing (load-bearing)
2
+
3
+ **On the first user message of a session**, before responding to the substance of the request, before running any tool, before asking any clarifying question:
4
+
5
+ 1. **Classify the flow.** One of: Research, Plan, Implement (Build/Fix/Improve/Investigate-Only), Verify, Monitor, Intake, Debrief, or No flow. If a slash command was invoked, the flow is already determined.
6
+ 2. **Echo the chosen flow** with a one-sentence justification. Example:
7
+ > **Flow: Implement/Fix** — bug report with reproduction steps.
8
+ 3. **Echo orchestration mode in the same message.** One of:
9
+ > **Orchestration: agent team** — Research, Plan, Implement, Intake, Debrief, and any flow that invokes Review.
10
+ > **Orchestration: single agent** — Verify (standalone), Monitor (standalone), product-walkthrough standalone, debrief-apply, one-off diagnostic sessions.
11
+ 4. **Check the readiness gate.** If gate fails interactively, ask for what's missing with recommended answers; do not start work. Headless/`-p` sessions infer from available context instead of blocking.
12
+ 5. **Cascade rule.** If you are already inside an agent team (a TeamCreate succeeded earlier this session, or you were spawned into a team context), do **not** create a second team. Add specialists through the existing lead. On Claude, teams are flat — message the lead with teammate + assignment. On Codex, use `multi_agent_v1.spawn_agent`.
13
+
14
+ Once a flow is established, **do not re-classify** on later messages, even if a follow-up looks vague ("now run the tests", "thanks"). Subsequent messages inherit the established flow unless the user explicitly changes scope.
15
+
16
+ Skipping classification or orchestration echo leads to unstructured responses that bypass readiness gates.
17
+
18
+ Full reference (flow definitions, readiness gates, orchestration matrix, sub-flows): [reference/intent-routing.md](../reference/intent-routing.md).
@@ -0,0 +1,39 @@
1
+ # Leaf-Only Build-Ready Invariant (load-bearing)
2
+
3
+ **Build-ready means a directly implementable leaf work unit.** Containers never carry build-ready.
4
+
5
+ A leaf is structurally defined: **no child work** AND a leaf-typed item (Bug, Task, Sub-task, Improvement). A container is a parent with children — Epic, Story, Spike, or any item that has acquired sub-items.
6
+
7
+ ## Invariant
8
+
9
+ - **At decomposition/write time** — only leaves receive the `ready` role. Parent containers are created in their non-ready state.
10
+ - **At validate time** — `*-validate-*` FAILs any container carrying the build-ready role.
11
+ - **At claim time** — build-intake claims leaves only. A container with a stale build-ready role is rolled up or safe-blocked, NEVER implemented.
12
+
13
+ ## Childless-parent exception
14
+
15
+ A container *type* with no children is structurally a leaf — and may be build-ready iff its type is itself a leaf type:
16
+
17
+ - **Task or Bug with no children** → leaf → may be build-ready.
18
+ - **Epic, Story, or Spike with no children** → still NOT build-ready. These are coordination containers by design; an empty one is incomplete decomposition. Repair: decompose into leaves, or reclassify to a leaf type.
19
+
20
+ ## Parent state rollup (priority order, first match wins)
21
+
22
+ 1. Any leaf is **blocked** → parent rolls up to **blocked / attention-needed**.
23
+ 2. Else any leaf is **claimed or in review** → parent is **in-progress**.
24
+ 3. Else all required leaves are **terminal (`done`)** → parent reaches the configured rollup terminal (env-keyed `done`).
25
+ 4. Else (leaves exist but none started) → parent unchanged.
26
+
27
+ **Blocked dominates.** Optional/won't-do children do not hold a parent open. Rollup is recursive — bottom-up. The parent never carries `ready`.
28
+
29
+ ## Terminal native closure
30
+
31
+ When a leaf reaches the true terminal `done` (the production / final-env value), also finalize via the tracker's native completion mechanism:
32
+
33
+ - **GitHub** — `gh issue close <n> --reason completed` after the terminal label.
34
+ - **Linear** — move workflow `state` to the team's Done.
35
+ - **JIRA** — transition to terminal Done/Resolved/Closed; verify `statusCategory = Done`.
36
+
37
+ Intermediate env-keyed states (`status:on-dev`, `On Stg`, etc.) remain open. Idempotent — if already closed, report and continue.
38
+
39
+ Full vendor mechanics + the state machine in prose: [reference/leaf-only-lifecycle.md](../reference/leaf-only-lifecycle.md).
@@ -0,0 +1,31 @@
1
+ # PRD Lifecycle Rollup & Generated-Top-Level-Work Contract (load-bearing)
2
+
3
+ The vendor-neutral source of truth for how a PRD owns the work it generated and how its lifecycle rolls up to `shipped`. Companion to `leaf-only-lifecycle` (which governs build-lifecycle of leaves); this rule governs PRD lifecycle and rollup from generated top-level children.
4
+
5
+ ## Generated top-level work (the contract)
6
+
7
+ A PRD owns the work units it created **at the top of the hierarchy** — the Epic(s) and any top-level Story it created directly. It does NOT own descendants (Sub-tasks, Stories under an Epic, leaves under a top-level unit) — those are owned by their top-level parent and roll up via `leaf-only-lifecycle`.
8
+
9
+ Leaf Sub-tasks are **never** direct children of a PRD when a top-level Epic/Story hierarchy exists.
10
+
11
+ ## How each vendor records the PRD→child link
12
+
13
+ **Native hierarchy first**, machine-readable fallback section always written:
14
+
15
+ - **GitHub Issues** — native sub-issues when source and tracker are the same repo + supports sub-issues.
16
+ - **Linear** — `parentId` or generated Project grouping where the PRD also lives in Linear.
17
+ - **JIRA** — Epic link / parent field, or documented issue-link type.
18
+ - **Confluence / Notion** — no native issue hierarchy; the documented `## Tickets` / `## Generated Work` section IS the source of truth.
19
+ - **Cross-vendor** (e.g. Notion PRD → JIRA tracker) — always documented section in the PRD source.
20
+
21
+ The documented `## Tickets` section is ALWAYS written (additive to native links) so the generated set is readable without parsing comments.
22
+
23
+ ## Rollup transition
24
+
25
+ PRD rolls from `ticketed` to `shipped` when every required generated top-level child is terminal. The PRD remains open for `/lisa:verify-prd` after `shipped` — verified PASS performs native closure (archive/close/transition), verified FAIL re-opens to `ticketed` with build-ready fix tickets (never `blocked`).
26
+
27
+ ## Idempotency dedupe key
28
+
29
+ Re-runs of intake/backlink must dedupe by child-ref identity (e.g. `owner/repo#number` for GitHub, Linear issue UUID, JIRA key) — never by URL string, which varies by formatting.
30
+
31
+ Full vendor matrix, predicate definitions, non-goals: [reference/prd-lifecycle-rollup.md](../reference/prd-lifecycle-rollup.md).