@esoteric-logic/praxis-harness 1.1.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 (79) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +192 -0
  3. package/base/CLAUDE.md +148 -0
  4. package/base/commands/context-reset.md +72 -0
  5. package/base/commands/debug.md +63 -0
  6. package/base/commands/discover.md +49 -0
  7. package/base/commands/gsd-discuss.md +53 -0
  8. package/base/commands/gsd-execute.md +60 -0
  9. package/base/commands/gsd-verify.md +78 -0
  10. package/base/commands/kit.md +62 -0
  11. package/base/commands/plan.md +91 -0
  12. package/base/commands/ralph.md +110 -0
  13. package/base/commands/review.md +81 -0
  14. package/base/commands/risk.md +53 -0
  15. package/base/commands/ship.md +74 -0
  16. package/base/commands/spec.md +121 -0
  17. package/base/commands/standup.md +57 -0
  18. package/base/rules/architecture.md +51 -0
  19. package/base/rules/azure.md +90 -0
  20. package/base/rules/code-quality.md +65 -0
  21. package/base/rules/coding.md +139 -0
  22. package/base/rules/communication.md +69 -0
  23. package/base/rules/context-management.md +136 -0
  24. package/base/rules/execution-loop.md +84 -0
  25. package/base/rules/git-workflow.md +51 -0
  26. package/base/rules/github-actions.md +48 -0
  27. package/base/rules/powershell.md +72 -0
  28. package/base/rules/profile.md +31 -0
  29. package/base/rules/security.md +40 -0
  30. package/base/rules/terraform.md +48 -0
  31. package/base/rules/vault.md +134 -0
  32. package/base/skills/code-gc/SKILL.md +205 -0
  33. package/base/skills/code-simplifier/SKILL.md +132 -0
  34. package/base/skills/prd-writer/SKILL.md +108 -0
  35. package/base/skills/prd-writer/references/prd-template.md +22 -0
  36. package/base/skills/pre-commit-lint/SKILL.md +71 -0
  37. package/base/skills/scaffold-exist/SKILL.md +85 -0
  38. package/base/skills/scaffold-new/SKILL.md +177 -0
  39. package/base/skills/scaffold-new/references/claude-progress-template.json +24 -0
  40. package/base/skills/scaffold-new/references/gitignore-template.txt +65 -0
  41. package/base/skills/scaffold-new/references/repo-CLAUDE-md-template.md +87 -0
  42. package/base/skills/scaffold-new/references/vault-index-template.md +31 -0
  43. package/base/skills/scaffold-new/references/vault-learnings-template.md +21 -0
  44. package/base/skills/scaffold-new/references/vault-status-template.md +21 -0
  45. package/base/skills/scaffold-new/references/vault-tasks-template.md +20 -0
  46. package/base/skills/session-retro/SKILL.md +146 -0
  47. package/base/skills/subagent-review/SKILL.md +126 -0
  48. package/base/skills/vault-gc/SKILL.md +93 -0
  49. package/base/skills/verify-app/SKILL.md +156 -0
  50. package/bin/praxis.js +385 -0
  51. package/kits/infrastructure/KIT.md +66 -0
  52. package/kits/infrastructure/commands/infra-apply.md +44 -0
  53. package/kits/infrastructure/commands/infra-compliance.md +65 -0
  54. package/kits/infrastructure/commands/infra-drift.md +45 -0
  55. package/kits/infrastructure/commands/infra-plan.md +45 -0
  56. package/kits/infrastructure/install.sh +43 -0
  57. package/kits/infrastructure/rules/infrastructure.md +82 -0
  58. package/kits/infrastructure/teardown.sh +14 -0
  59. package/kits/web-designer/KIT.md +76 -0
  60. package/kits/web-designer/commands/web-audit.md +67 -0
  61. package/kits/web-designer/commands/web-component.md +54 -0
  62. package/kits/web-designer/commands/web-init.md +42 -0
  63. package/kits/web-designer/commands/web-tokens-sync.md +49 -0
  64. package/kits/web-designer/install.sh +41 -0
  65. package/kits/web-designer/rules/web-design.md +79 -0
  66. package/kits/web-designer/teardown.sh +26 -0
  67. package/package.json +28 -0
  68. package/scripts/health-check.sh +160 -0
  69. package/scripts/lint-harness.sh +195 -0
  70. package/scripts/onboard-mcp.sh +326 -0
  71. package/scripts/update.sh +88 -0
  72. package/templates/_index.md +33 -0
  73. package/templates/adr.md +28 -0
  74. package/templates/claude-progress.json +24 -0
  75. package/templates/plan.md +46 -0
  76. package/templates/project-index.md +31 -0
  77. package/templates/session-note.md +21 -0
  78. package/templates/status.md +27 -0
  79. package/templates/tasks.md +27 -0
@@ -0,0 +1,84 @@
1
+ # Execution Loop — Rules
2
+ # Scope: All projects, all sessions
3
+ # Extracted from ~/.claude/CLAUDE.md to reduce root file size
4
+
5
+ ## Core Loop (MANDATORY — every non-trivial task)
6
+
7
+ ### Phase 1: SPEC
8
+ Answer four questions before any code or file is written:
9
+ - **WHAT**: Concrete deliverable (not vague goals)
10
+ - **DONE-WHEN**: Specific checks that prove completion
11
+ - **CONSTRAINTS**: Performance, compatibility, style requirements
12
+ - **NON-GOALS**: What this task explicitly does NOT include
13
+ If ambiguous: ask 2–3 clarifying questions before proceeding.
14
+
15
+ ### Risk Check (MANDATORY if any apply)
16
+ Run `/risk` before proceeding to PLAN if the task:
17
+ - Touches infrastructure files (`*.tf`, `*.bicep`, `*.yml` in `.github/workflows/`)
18
+ - Touches authentication, credentials, or secrets handling
19
+ - Modifies >3 files across different domains
20
+ - Has a NON-GOALS list that explicitly defers something risky
21
+
22
+ If any condition is met: `/risk` must produce at minimum one risk entry before `/gsd:plan-phase`.
23
+
24
+ ### Phase 2: PLAN
25
+ - Break work into milestones small enough to complete and verify in one pass.
26
+ - Each milestone MUST have: description, acceptance criteria, validation command.
27
+ - Save plan to `{vault_path}/plans/YYYY-MM-DD_[task-slug].md` with frontmatter:
28
+ ```yaml
29
+ ---
30
+ created: YYYY-MM-DD
31
+ status: active
32
+ tags: [relevant, tags]
33
+ ---
34
+ ```
35
+ - Update `{vault_path}/status.md` → `current_plan:` field.
36
+ - Do NOT begin implementation until the plan is approved.
37
+
38
+ ### Phase 3: IMPLEMENT
39
+ - One milestone at a time. Keep diffs scoped.
40
+ - Do not expand scope without explicit approval.
41
+ - Use extended thinking for tasks touching >3 files or requiring architectural decisions.
42
+
43
+ ### Phase 4: VALIDATE
44
+ After EACH milestone — show actual output, not assertions:
45
+ 1. Run test suite → show output
46
+ 2. Run linter → show output, fix ALL warnings
47
+ 3. Run typecheck (if applicable) → show output
48
+ 4. Run build (if applicable) → show output
49
+ 5. Report: PASS or FAIL with specifics
50
+
51
+ ### Phase 5: REPAIR (Stop-and-Fix)
52
+ If ANY validation fails:
53
+ - Do NOT proceed to the next milestone.
54
+ - Fix NOW. Re-validate. Then proceed.
55
+ - If cannot fix in 3 attempts: STOP.
56
+ Report: **What** (full error + 3 attempts) → **So What** (root cause) → **Now What** (next steps)
57
+
58
+ ### Phase 6: COMMIT
59
+ - Commit at milestone completion. See git-workflow.md.
60
+ - Never let uncommitted work span multiple milestones.
61
+
62
+ ### Phase 7: LOG
63
+ - Update `{vault_path}/status.md`: what was done, decisions made, what's next.
64
+ - Mark completed milestone status in the plan file.
65
+ - Update `{vault_path}/_index.md` goals if project direction changed.
66
+ - Vault indexing is automatic (obsidian) or not needed (other backends).
67
+
68
+ ### Phase 8: REPEAT
69
+ Next milestone. Loop until plan complete.
70
+
71
+ ## Self-Review Protocol
72
+ After ALL milestones, before reporting done:
73
+ 1. Use a subagent to review the diff as a critical code reviewer.
74
+ Prompt: "Review this diff for bugs, edge cases, error handling gaps, security issues,
75
+ and violations of project conventions. Rate each: Critical / Major / Minor."
76
+ — Subagent receives ONLY: the diff, the SPEC, relevant rules files. NOT the conversation history.
77
+ 2. Address all Critical and Major findings.
78
+ 3. Re-validate after fixes.
79
+ 4. If reviewer found >3 issues: run review again (max 3 rounds).
80
+
81
+ ## Context Management
82
+ See `~/.claude/rules/context-management.md` for complete context discipline:
83
+ GSD phase scoping, Ralph story sizing, context reset protocol.
84
+ - Use subagents (Task tool) for exploration, research, and review.
@@ -0,0 +1,51 @@
1
+ # Git Workflow — Rules
2
+ # Scope: All projects with git repos
3
+
4
+ ## Identity — Invariants (BLOCK on violation)
5
+ <!-- CUSTOMIZE: Replace with your git identities -->
6
+ <!-- Example identity table: -->
7
+ <!-- | Type | gitconfig | SSH Key | Email | includeIf Path | -->
8
+ <!-- |------|-----------|---------|-------|----------------| -->
9
+ <!-- | Work | ~/.gitconfig-work | ~/.ssh/id_ed25519_work | you@company.com | ~/Projects/Work/ | -->
10
+ <!-- | Personal | ~/.gitconfig-personal | ~/.ssh/id_ed25519_personal | you@personal.com | ~/Projects/Personal/ | -->
11
+
12
+ **Verification:** `git --no-pager config user.email`
13
+ **On mismatch:** STOP. Report `expected: X, got: Y`. Do not commit.
14
+
15
+ ## Branch Strategy
16
+ - Feature branches off `main`: `feat/[task-slug]` or `fix/[task-slug]`
17
+ - Never commit directly to `main`
18
+ - Delete branches after merge
19
+
20
+ ## Commit Standards
21
+ - Commit at every completed milestone. Never batch milestones into one commit.
22
+ - Format:
23
+ ```
24
+ type(scope): concise description
25
+
26
+ - What changed and why (not how)
27
+ - Milestone reference if applicable
28
+ ```
29
+ Types: `feat`, `fix`, `refactor`, `test`, `docs`, `chore`
30
+ - Never amend published commits — use new commits for fixes.
31
+ - Always use `git --no-pager` for all git commands.
32
+ - Keep working tree clean — no untracked debris, no partial stages.
33
+
34
+ ## Pre-Commit Invariants (BLOCK on violation)
35
+ 1. Secret scan staged files: `rg "(sk-|ghp_|pplx-|AKIA|Bearer [A-Za-z0-9+/]{20,})" $(git diff --staged --name-only)`
36
+ 2. Confirm `git config user.email` matches expected identity for this repo path.
37
+ 3. Run stack linter (see terraform.md, github-actions.md as applicable).
38
+ 4. Run typecheck if applicable — no commits with type errors.
39
+
40
+ ## Rollback Protocol
41
+ When a previously-passing milestone breaks:
42
+ 1. Identify breaking commit: `git bisect` or `git --no-pager log --oneline`
43
+ 2. Surgical fix (<10 lines, isolated): fix forward, re-validate, commit.
44
+ 3. Complex or unclear: `git revert <breaking-commit>`, re-validate, re-approach with revised plan.
45
+ 4. Never leave `main` broken. If can't fix or revert cleanly: STOP and report.
46
+
47
+ ## Vault Git Checkpoint Rule
48
+ Vault is git-tracked. Read vault_path from `~/.claude/praxis.config.json`.
49
+ - Auto-committed at session end by the export hook.
50
+ - Do not manually commit vault files during a session unless explicitly asked.
51
+ - Vault indexing is automatic (obsidian) or not needed (other backends).
@@ -0,0 +1,48 @@
1
+ ---
2
+ paths:
3
+ - ".github/workflows/**"
4
+ - ".github/actions/**"
5
+ ---
6
+ # GitHub Actions — Rules
7
+ # Scope: Projects with .github/workflows/*.yml files
8
+
9
+ ## Invariants (BLOCK on violation)
10
+
11
+ ### Secret Handling
12
+ - NEVER hardcode secrets in workflow files — use `${{ secrets.NAME }}` only.
13
+ - NEVER print secrets to logs — mask all secret values.
14
+ - Check: `rg "(password|token|key|secret)\s*[:=]\s*['\"]?[A-Za-z0-9+/]{8,}" .github/`
15
+ - On violation: BLOCK commit immediately.
16
+
17
+ ### Action Pinning
18
+ - Pin all third-party actions to a full commit SHA, not a tag.
19
+ Correct: `uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683`
20
+ Incorrect: `uses: actions/checkout@v4`
21
+
22
+ ### Permissions
23
+ - Declare explicit `permissions:` block on every job — no implicit defaults.
24
+ - Minimum required permissions only. No `write-all`.
25
+
26
+ ## Conventions (WARN on violation)
27
+
28
+ ### Workflow Structure
29
+ - One workflow file per concern (deploy, test, lint — not one monolithic workflow)
30
+ - Job names: kebab-case, descriptive (`deploy-staging`, not `job1`)
31
+ - Use `environment:` protection rules for production deployments
32
+
33
+ ### Triggers
34
+ - Be explicit — avoid `on: push` without branch filters
35
+ - PRs: `on: pull_request: branches: [main]`
36
+ - Deploys: `on: push: branches: [main]` or manual `workflow_dispatch`
37
+
38
+ ## Verification Commands
39
+ ```bash
40
+ # actionlint (if installed)
41
+ actionlint .github/workflows/*.yml
42
+
43
+ # Check for unpinned actions
44
+ rg "uses: [^@]+@(v[0-9]|main|master|latest)" .github/
45
+
46
+ # Check for hardcoded secrets
47
+ rg "(password|token|key|secret)\s*[:=]\s*['\"]?[A-Za-z0-9+/]{8,}" .github/
48
+ ```
@@ -0,0 +1,72 @@
1
+ ---
2
+ paths:
3
+ - "**/*.ps1"
4
+ - "**/*.psm1"
5
+ - "**/*.psd1"
6
+ ---
7
+ # PowerShell — Rules
8
+ # Scope: Projects with *.ps1 files
9
+ # Runtime: PowerShell 7+ required. PSScriptAnalyzer required for lint.
10
+
11
+ ## Invariants (BLOCK on violation)
12
+
13
+ ### Error Handling
14
+ - Every script MUST begin with: `Set-StrictMode -Version Latest`
15
+ - Every script MUST begin with: `$ErrorActionPreference = 'Stop'`
16
+ - No bare `catch {}` blocks — every catch must either re-throw or log + re-throw.
17
+ - No `-ErrorAction SilentlyContinue` without an explicit comment explaining why.
18
+
19
+ ### Secrets
20
+ - No hardcoded credentials, connection strings, or tokens in any .ps1 file.
21
+ - Key Vault references preferred: `Get-AzKeyVaultSecret -VaultName $VaultName -Name $SecretName`
22
+ - Never log sensitive values — mask before `Write-Host` or `Write-Output`.
23
+
24
+ ## Conventions (WARN on violation)
25
+
26
+ ### Naming
27
+ - Functions: `Verb-Noun` format, approved PowerShell verbs only.
28
+ - Variables: `$PascalCase` for script-scope, `$camelCase` for local loop vars.
29
+ - Parameters: `$PascalCase`, always typed.
30
+ - Files: `Verb-Noun.ps1` matching the primary function name.
31
+
32
+ ### Structure
33
+ Every script must have:
34
+ ```powershell
35
+ #Requires -Version 7.0
36
+ Set-StrictMode -Version Latest
37
+ $ErrorActionPreference = 'Stop'
38
+
39
+ <#
40
+ .SYNOPSIS
41
+ One-line description.
42
+ .DESCRIPTION
43
+ Full description.
44
+ .PARAMETER ParamName
45
+ Description.
46
+ .EXAMPLE
47
+ ./Script-Name.ps1 -Param Value
48
+ #>
49
+ param(
50
+ [Parameter(Mandatory)]
51
+ [string]$RequiredParam
52
+ )
53
+ ```
54
+
55
+ ### Output
56
+ - Use `Write-Host` for human-readable progress (goes to host, not pipeline).
57
+ - Use `Write-Output` or `return` for pipeline data.
58
+ - Use `Write-Warning` for non-fatal issues.
59
+ - Use `Write-Error` or `throw` for fatal issues — never silently continue.
60
+ - Structured output: return `[PSCustomObject]` for data, not formatted strings.
61
+
62
+ ## Verification Commands
63
+ ```powershell
64
+ # PSScriptAnalyzer lint (if installed)
65
+ Invoke-ScriptAnalyzer -Path . -Recurse -Severity Warning,Error
66
+
67
+ # Check for SilentlyContinue without comments
68
+ rg "SilentlyContinue" --glob "*.ps1" .
69
+
70
+ # Check for missing StrictMode
71
+ rg -L "Set-StrictMode" --glob "*.ps1" .
72
+ ```
@@ -0,0 +1,31 @@
1
+ # Profile
2
+ # Universal — loads every session. Static context foundation.
3
+ # No paths: scoping — always in context
4
+
5
+ ## Setup Detection
6
+ If "Your Name" or "Your Role" appears below, this file is not configured.
7
+ STOP and tell the user:
8
+ "profile.md is not configured. Fill in Who You Are Working With below before starting."
9
+ Do NOT proceed with an empty profile — it causes silent context gaps every session.
10
+
11
+ ## Who You Are Working With
12
+ Your Name — Your Role. Primary focus: your domains.
13
+
14
+ ## Active Projects
15
+ Project context is loaded dynamically per session via /scaffold-new and /standup.
16
+ Do NOT maintain a static project list here — it will drift.
17
+ To add a new project: run /scaffold-new in the project repo.
18
+ To see current project state: run /standup.
19
+
20
+ ## How You Work
21
+ - Writes for two audiences: technical implementers and non-technical stakeholders.
22
+ - Communication style: direct, structured, What/So What/Now What.
23
+ - Deliverables over discussion — prefers concrete output to long explanations.
24
+ - Vault-first: decisions, specs, and plans live in the vault, not in conversation.
25
+ - Git identity is project-specific — always verify before committing.
26
+
27
+ ## What Claude Should Always Remember
28
+ - Never assume a dormant project is dead — verify from status.md before deprioritizing.
29
+ - When project context is ambiguous: check CWD against local_path in vault _index.md before asking.
30
+ - Context7 is installed — always use it before implementing with an external library or API.
31
+ - Add any project-agnostic rules or constraints here (not project-specific — those go in repo CLAUDE.md).
@@ -0,0 +1,40 @@
1
+ # Security — Rules
2
+ # Scope: All projects, all sessions
3
+
4
+ ## Invariants (BLOCK on violation)
5
+
6
+ ### Secrets
7
+ - NEVER hardcode secrets — no API keys, tokens, passwords, connection strings in code.
8
+ Use environment variables or a secrets manager.
9
+ - If a secret is found in code: flag immediately, do not proceed until remediated.
10
+ - Pre-commit scan (always): `rg "(sk-|ghp_|pplx-|AKIA|Bearer [A-Za-z0-9+/]{20,})" $(git diff --staged --name-only)`
11
+ - Secrets in logs: never log request bodies, headers, or responses that may contain credentials. Redact before logging.
12
+
13
+ ### Input Validation
14
+ - Validate all inputs at boundaries — APIs, user input, file uploads, environment variables.
15
+ - Never trust external data without validation.
16
+ - Validate response shape, not just status code — 200 with error body is a silent failure.
17
+
18
+ ### Permissions
19
+ - Least privilege — request only permissions and scopes needed.
20
+ - No wildcard IAM policies. No `chmod 777`.
21
+ - GitHub Actions: pin action versions to commit SHA, not tags.
22
+
23
+ ## Conventions (WARN on violation)
24
+
25
+ ### Dependencies
26
+ - Audit new dependencies before adding: `npm audit`, `pip audit`, or equivalent.
27
+ - Check for known CVEs before adding any package.
28
+ - Pin to exact versions. No floating ranges in production.
29
+
30
+ ## Verification Commands
31
+ ```bash
32
+ # Secret scan staged files
33
+ rg "(sk-|ghp_|pplx-|AKIA|Bearer [A-Za-z0-9+/]{20,})" $(git diff --staged --name-only)
34
+
35
+ # Secret scan entire repo (audit mode)
36
+ rg "(sk-|ghp_|pplx-|AKIA|Bearer [A-Za-z0-9+/]{20,})" --glob "!*.lock" .
37
+
38
+ # Check for .env files accidentally staged
39
+ git diff --staged --name-only | grep -E "\.env$|\.env\."
40
+ ```
@@ -0,0 +1,48 @@
1
+ ---
2
+ paths:
3
+ - "**/*.tf"
4
+ - "**/*.tfvars"
5
+ - "**/*.tfplan"
6
+ ---
7
+ # Terraform — Rules
8
+ # Scope: Projects with .tf files
9
+
10
+ ## Invariants (BLOCK on violation)
11
+
12
+ ### State Management
13
+ - Remote state ONLY — no local state files ever committed.
14
+ - Backend config must not contain secrets — use environment variables or Key Vault refs.
15
+ - State locking required — never disable lock without explicit reason + approval.
16
+ - `terraform plan` must be reviewed before every `apply`. No blind applies.
17
+
18
+ ### Layer Boundaries (enforce with rg checks)
19
+ - `modules/` → MUST NOT reference `../environments/` directly
20
+ Check: `rg 'source\s*=\s*"\.\.\/environments' modules/`
21
+ - `environments/` → MUST NOT contain resource definitions, only variable calls
22
+ Check: `rg '^resource "' environments/`
23
+ - On violation: BLOCK commit. Hard stop.
24
+
25
+ ### Formatting
26
+ - `terraform fmt -recursive` must pass before any commit touching .tf files.
27
+ - `terraform validate` must pass.
28
+
29
+ ## Conventions (WARN on violation)
30
+
31
+ ### Naming
32
+ - Resources: `{project}-{env}-{resource_type}-{purpose}`
33
+ - Variables: snake_case
34
+ - Outputs: snake_case, descriptive
35
+ - Modules: kebab-case directory names
36
+
37
+ ### Provider
38
+ - Pin provider versions exactly — no `~>` in production
39
+ - Managed identity preferred over service principal where possible
40
+ - Tag all resources: `project`, `environment`, `owner`, `created_by = "terraform"`
41
+
42
+ ## Verification Commands
43
+ ```bash
44
+ terraform fmt -recursive -check
45
+ terraform validate
46
+ rg 'source\s*=\s*"\.\.\/environments' modules/
47
+ rg '^resource "' environments/
48
+ ```
@@ -0,0 +1,134 @@
1
+ # Vault — Second Brain Integration
2
+ <!-- Universal — loads every session. Defines how Claude interacts with the vault. -->
3
+
4
+ ---
5
+
6
+ ## Backend Detection
7
+ Read `vault_backend` from `~/.claude/praxis.config.json`. Defaults to `"obsidian"` if absent.
8
+
9
+ | Backend | Search command | Update after write | Link format |
10
+ |---------|---------------|-------------------|-------------|
11
+ | `obsidian` | `obsidian search query="{query}" limit=5` | no-op (real-time indexing) | `[[wikilinks]]` |
12
+ | `logseq` | `rg -l "{query}" {vault_path} --glob "*.md" \| head -5` | no-op | standard markdown links |
13
+ | `plain` | `rg -l "{query}" {vault_path} --glob "*.md" \| head -5` | no-op | standard markdown links |
14
+ | `custom` | `rg -l "{query}" {vault_path} --glob "*.md" \| head -5` | no-op | standard markdown links |
15
+
16
+ **Note:** The Obsidian CLI requires Obsidian to be running. If Obsidian is not running, vault search will fail.
17
+ Scope searches with `path=` filter: `obsidian search query="{query}" path="01_Projects" limit=5`
18
+
19
+ All commands below use the backend table above. When a step says "vault search" or "vault update", substitute the correct command for the active backend.
20
+
21
+ ## Vault Location
22
+ Read vault_path from `~/.claude/praxis.config.json`.
23
+ If the config file is missing, tell the user to run `praxis/install.sh`.
24
+ All `{vault_path}` references below resolve from this config.
25
+
26
+ ---
27
+
28
+ ## The Vault Is the Brain — Not Conversation
29
+
30
+ Decisions made in conversation but not written to `specs/` do not exist next session.
31
+ Plans discussed but not written to `plans/` will be re-discovered and re-debated.
32
+ This is entropy. The vault prevents it.
33
+
34
+ ---
35
+
36
+ ## Invariants — BLOCK on violation
37
+
38
+ ### Search before reading
39
+ - ALWAYS run a vault search before reading vault files.
40
+ - Never navigate to a vault file by path alone — you may read a stale or superseded version.
41
+
42
+ ### Auto-save these to vault without being asked
43
+ - Architecture decisions → `specs/YYYY-MM-DD_title.md`
44
+ - Technical specs or designs → `specs/YYYY-MM-DD_title.md`
45
+ - Research findings (>3 sentences) → `research/YYYY-MM-DD_topic.md`
46
+ - Risk register entries → `specs/risk-register.md`
47
+ - Patterns or corrections discovered → `notes/learnings.md` as [LEARN:tag]
48
+ - Meeting notes or client context → `notes/YYYY-MM-DD_meeting.md`
49
+
50
+ Never ask "should I save this?" for the above categories — just save it.
51
+
52
+ ### No manual index update needed
53
+ - Obsidian indexes vault changes in real-time — no update command required.
54
+ - For all other backends: files are read directly, no indexing needed.
55
+
56
+ ---
57
+
58
+ ## Conventions — WARN on violation
59
+
60
+ ### Project detection
61
+ - Detect current project by matching CWD against `local_path` in any `_index.md`.
62
+ - If CWD is ambiguous: ask before writing to vault. Never guess which project.
63
+
64
+ ### Vault file purposes — strict separation
65
+
66
+ | File | Contains | Does NOT contain |
67
+ |------|---------|-----------------|
68
+ | `_index.md` | Project metadata: repo, stack, goals, links | Session state, plans, decisions |
69
+ | `status.md` | Execution state: What/So What/Now What. **Max 100 lines.** Archive resolved items to `notes/`. | Historical completed work, session transcripts |
70
+ | `tasks.md` | Active/Backlog/Blocked/Completed task lists | Specs, decisions, research |
71
+ | `plans/` | Dated work plans with milestones and steps | Completed archives |
72
+ | `specs/` | ADRs, technical specs, risk register, proposals | In-progress drafts |
73
+ | `research/` | Investigation findings before decisions | Decisions (those go to specs/) |
74
+ | `notes/learnings.md` | [LEARN:tag] entries, patterns, corrections | General meeting notes |
75
+
76
+ ### Writing format for vault files
77
+ Every vault file must have YAML frontmatter:
78
+ ```yaml
79
+ ---
80
+ tags: [type, project-slug]
81
+ date: YYYY-MM-DD
82
+ source: agent | human | meeting
83
+ ---
84
+ ```
85
+
86
+ Link format depends on backend:
87
+ - `obsidian` → use `[[wikilinks]]` for all internal vault references
88
+ - `logseq`, `plain`, `custom` → use standard markdown links
89
+
90
+ ### Bootstrap templates
91
+ If `status.md`, `tasks.md`, or `_index.md` are missing from a project vault directory,
92
+ scaffold them from `templates/` in the praxis repo. Run `/scaffold-exist` if the
93
+ project predates the scaffold standard. Never create these files freehand — use templates.
94
+
95
+ ### Planning workflow
96
+ When "let's work on X" or "plan out Y":
97
+ 1. Run `/plan` to create a dated plan in `vault/plans/`
98
+ 2. Update `status.md` current_plan field
99
+ 3. Work from the plan — check off milestones as they complete
100
+ 4. At session end: run `/session-retro`
101
+
102
+ **The vault drives work. Conversation is the interface, not the record.**
103
+
104
+ ### Status digest discipline
105
+ - status.md must stay under 100 lines. If it exceeds this: archive resolved
106
+ What/So What/Now What sections to `notes/{date}_status-archive.md` and trim.
107
+ - Required fields at top (always present):
108
+ ```
109
+ current_plan: {path or "none"}
110
+ last_updated: {YYYY-MM-DD}
111
+ last_session: {ISO timestamp}
112
+ loop_position: DISCUSS | PLAN | EXECUTE | VERIFY | IDLE
113
+ ```
114
+ - loop_position tracks where in the GSD cycle the project currently sits.
115
+ Update at every phase transition.
116
+ - A status.md older than 14 days is stale. vault-gc flags these.
117
+
118
+ ---
119
+
120
+ ## Second Brain Principles
121
+
122
+ **Write decisions when they're made, not when they're needed.**
123
+
124
+ **Update status.md at the end of every session.**
125
+ vault-gc flags projects where status.md is >14 days stale.
126
+
127
+ **Use [LEARN:tag] for patterns, not just errors.**
128
+ Every time something works better than expected, log why.
129
+
130
+ ---
131
+
132
+ ## Removal Condition
133
+ Permanent. Remove only if persistent vault state is replaced by
134
+ a different mechanism entirely.