@esoteric-logic/praxis-harness 2.11.0 → 2.13.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.
- package/base/CLAUDE.md +37 -3
- package/base/agents/evaluator.md +44 -0
- package/base/agents/planner.md +48 -0
- package/base/hooks/auto-format.sh +1 -1
- package/base/hooks/dep-audit.sh +1 -1
- package/base/hooks/file-guard.sh +3 -3
- package/base/hooks/recursion-guard.sh +7 -1
- package/base/hooks/session-data-collect.sh +1 -1
- package/base/hooks/vault-checkpoint.sh +5 -5
- package/base/rules/code-excellence.md +22 -0
- package/base/rules/coding.md +16 -0
- package/base/rules/context-budget.md +66 -0
- package/base/rules/context-management.md +4 -0
- package/base/rules/hooks-policy.md +53 -0
- package/base/rules/multi-agent-orchestration.md +99 -0
- package/base/rules/observable-code.md +87 -0
- package/base/rules/phase-detection.md +52 -0
- package/base/rules/refactor-triggers.md +59 -0
- package/base/rules/self-repair.md +53 -0
- package/base/rules/session-bridge.md +39 -0
- package/base/rules/session-metrics.md +61 -0
- package/base/rules/skill-authoring.md +85 -0
- package/base/rules/writing-quality.md +122 -0
- package/base/skills/px-compact/SKILL.md +100 -0
- package/base/skills/px-complexity-audit/SKILL.md +118 -0
- package/base/skills/px-context-probe/SKILL.md +1 -1
- package/base/skills/px-context-triage/SKILL.md +76 -0
- package/base/skills/px-discover/SKILL.md +4 -1
- package/base/skills/px-discuss/SKILL.md +4 -1
- package/base/skills/px-doc-lint/SKILL.md +107 -0
- package/base/skills/px-prose-review/SKILL.md +96 -0
- package/base/skills/px-quality-gate/SKILL.md +182 -0
- package/base/skills/px-risk/SKILL.md +4 -1
- package/base/skills/px-scaffold-new/SKILL.md +16 -14
- package/base/skills/px-session-retro/SKILL.md +1 -1
- package/base/skills/px-spec/SKILL.md +6 -2
- package/base/skills/px-verify/SKILL.md +2 -1
- package/bin/praxis.js +27 -6
- package/kits/api/KIT.md +2 -0
- package/kits/api/install.sh +1 -1
- package/kits/api/teardown.sh +1 -1
- package/kits/code-quality/KIT.md +2 -0
- package/kits/code-quality/hooks/generate-baseline.sh +1 -1
- package/kits/code-quality/hooks/post-commit.sh +3 -2
- package/kits/code-quality/hooks/pre-push.sh +15 -15
- package/kits/code-quality/install.sh +1 -1
- package/kits/code-quality/teardown.sh +3 -3
- package/kits/data/KIT.md +2 -0
- package/kits/data/install.sh +1 -1
- package/kits/data/teardown.sh +1 -1
- package/kits/infrastructure/KIT.md +2 -0
- package/kits/infrastructure/install.sh +1 -1
- package/kits/infrastructure/teardown.sh +1 -1
- package/kits/security/KIT.md +2 -0
- package/kits/security/install.sh +1 -1
- package/kits/security/teardown.sh +1 -1
- package/kits/web-designer/KIT.md +2 -0
- package/kits/web-designer/install.sh +1 -1
- package/kits/web-designer/teardown.sh +1 -1
- package/package.json +1 -1
- package/scripts/health-check.sh +21 -15
- package/scripts/install-tools.sh +5 -5
- package/scripts/lint-harness.sh +1 -1
- package/scripts/onboard-mcp.sh +1 -1
- package/scripts/test-harness.sh +1 -1
- package/scripts/update.sh +1 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Phase Detection — Rules
|
|
2
|
+
# Scope: All projects, all sessions
|
|
3
|
+
# Automatic detection of current workflow phase for adaptive rule loading
|
|
4
|
+
|
|
5
|
+
## Phase Definitions
|
|
6
|
+
|
|
7
|
+
| Phase | Signals | Active Rule Focus |
|
|
8
|
+
| ----- | ------- | ----------------- |
|
|
9
|
+
| **Planning** | `/px-discuss`, `/px-plan`, `/px-spec` invoked; reading specs/plans; no code edits | engineering-judgment, architecture patterns |
|
|
10
|
+
| **Implementing** | Code files being written/edited; tests being written | code-quality, code-excellence, language-specific rules |
|
|
11
|
+
| **Testing** | Test files being run; test output being analyzed | self-verify, observable-code |
|
|
12
|
+
| **Debugging** | `/px-debug` invoked; error analysis; stack traces being read | coding (Context7 mandate), language-specific rules |
|
|
13
|
+
| **Reviewing** | `/px-review`, `/px-simplify` invoked; diff analysis | refactor-triggers, code-quality |
|
|
14
|
+
| **Shipping** | `/px-ship`, `/px-verify` invoked; pre-commit checks | git-workflow, security-posture |
|
|
15
|
+
|
|
16
|
+
## Detection Heuristic — Conventions (WARN on violation)
|
|
17
|
+
|
|
18
|
+
Phase detection is heuristic — infer from the most recent actions:
|
|
19
|
+
|
|
20
|
+
1. **Explicit signal**: A phase-associated skill was invoked → phase is known
|
|
21
|
+
2. **File type signal**: Editing `.ts` files → Implementing. Reading test output → Testing.
|
|
22
|
+
3. **Conversation signal**: Discussing tradeoffs → Planning. Analyzing errors → Debugging.
|
|
23
|
+
|
|
24
|
+
When phase is ambiguous: default to the broader rule set rather than the narrower one.
|
|
25
|
+
Loading extra rules is preferable to missing a constraint.
|
|
26
|
+
|
|
27
|
+
## Adaptive Loading Behavior — Conventions (WARN on violation)
|
|
28
|
+
|
|
29
|
+
### What changes per phase
|
|
30
|
+
- **Planning**: Prioritize engineering-judgment.md, deprioritize language-specific rules
|
|
31
|
+
- **Implementing**: Load language-specific rules for active file types, full code-quality
|
|
32
|
+
- **Reviewing**: Load refactor-triggers.md, emphasize simplicity checks
|
|
33
|
+
- **Shipping**: Load git-workflow.md pre-commit invariants, security-posture checks
|
|
34
|
+
|
|
35
|
+
### What never changes
|
|
36
|
+
Universal rules (14) are always loaded regardless of phase.
|
|
37
|
+
Phase detection adjusts emphasis and attention, not which rules are loaded.
|
|
38
|
+
Claude Code does not support dynamic rule unloading — phase detection shapes
|
|
39
|
+
which rules get actively applied, not which are present in context.
|
|
40
|
+
|
|
41
|
+
## Kit Phase Integration
|
|
42
|
+
|
|
43
|
+
Kits define `skills_chain` with phase fields in their manifests.
|
|
44
|
+
When a kit is active, its phases override the generic phases above:
|
|
45
|
+
- `code-quality` kit: gate → ai-review → self-review
|
|
46
|
+
- `infrastructure` kit: plan → apply → drift → compliance
|
|
47
|
+
- `web-designer` kit: design-system-init → component-build → audit → final-lint
|
|
48
|
+
|
|
49
|
+
Kit phases take precedence when the kit is active.
|
|
50
|
+
|
|
51
|
+
## Removal Condition
|
|
52
|
+
Remove when Claude Code provides native phase-aware rule loading.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Refactor Triggers — Pre-Check Protocol
|
|
2
|
+
# Scope: All code modifications
|
|
3
|
+
# Always active during code generation
|
|
4
|
+
# Cross-reference: code-quality.md defines the hard limits (30 lines, 3 nesting,
|
|
5
|
+
# 4 params, 300-line files, no TODO/FIXME). This file defines WHEN and HOW
|
|
6
|
+
# to refactor — not the thresholds themselves.
|
|
7
|
+
|
|
8
|
+
## Invariants — BLOCK on violation
|
|
9
|
+
|
|
10
|
+
### Before touching any existing file
|
|
11
|
+
Check the file against `code-quality.md` hard limits before adding code.
|
|
12
|
+
If the file already violates limits:
|
|
13
|
+
1. Do NOT add new code to it
|
|
14
|
+
2. Refactor the file to compliance first
|
|
15
|
+
3. THEN make the intended change
|
|
16
|
+
4. Commit the refactor separately from the feature
|
|
17
|
+
|
|
18
|
+
This is mandatory. Adding to an already-broken file compounds debt exponentially.
|
|
19
|
+
|
|
20
|
+
### Commit refactor separately from feature
|
|
21
|
+
- Refactoring commits use `refactor(scope):` prefix
|
|
22
|
+
- Feature commits use `feat(scope):` prefix
|
|
23
|
+
- Never mix structural changes and behavior changes in one commit
|
|
24
|
+
- Rationale: reviewers cannot distinguish "moved code" from "changed behavior" in a mixed diff
|
|
25
|
+
|
|
26
|
+
### Copy-paste detection
|
|
27
|
+
If you find yourself copying 3+ lines from elsewhere in the same codebase: stop.
|
|
28
|
+
Extract a shared function in a common location.
|
|
29
|
+
Duplication is the root of divergent behavior bugs.
|
|
30
|
+
|
|
31
|
+
## Conventions — WARN on violation
|
|
32
|
+
|
|
33
|
+
### The QUALITY comment convention
|
|
34
|
+
When you encounter a known violation in code you are NOT tasked with fixing:
|
|
35
|
+
```
|
|
36
|
+
// QUALITY: function exceeds 30 lines — refactor tracked in #123
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Rules for QUALITY comments:
|
|
40
|
+
- QUALITY: is the ONLY allowed debt marker. `TODO`, `FIXME`, and `HACK` are banned (see `code-quality.md`).
|
|
41
|
+
- Every QUALITY comment MUST include a tracking reference (issue number, ADR, or ticket).
|
|
42
|
+
- QUALITY comments are allowed in commits — unlike TODO/FIXME which are not.
|
|
43
|
+
- A QUALITY comment is NOT a license to defer indefinitely. It is a documented acknowledgment.
|
|
44
|
+
|
|
45
|
+
### Refactor vs rewrite decision gate
|
|
46
|
+
- **Refactor** (preferred): same behavior, improved structure. Small, safe, incremental.
|
|
47
|
+
- **Rewrite**: new behavior or complete structural replacement.
|
|
48
|
+
|
|
49
|
+
If >50% of a file needs changing during a feature task:
|
|
50
|
+
1. Stop. Do not incrementally refactor to the point of a full rewrite.
|
|
51
|
+
2. File an issue for the rewrite.
|
|
52
|
+
3. Complete the minimum viable refactor for the current feature.
|
|
53
|
+
4. Propose the rewrite as a separate milestone with its own plan.
|
|
54
|
+
|
|
55
|
+
Never rewrite during a feature task without an explicit plan.
|
|
56
|
+
|
|
57
|
+
## Removal Condition
|
|
58
|
+
Remove when automated refactoring tools (e.g., language-specific AST transforms)
|
|
59
|
+
handle pre-check validation and commit separation automatically.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Self-Repair — Rules
|
|
2
|
+
# Scope: All projects, all sessions
|
|
3
|
+
# Structured recovery protocol for repeated failures
|
|
4
|
+
|
|
5
|
+
## Recovery Escalation — Invariants (BLOCK on violation)
|
|
6
|
+
|
|
7
|
+
### Attempt tracking
|
|
8
|
+
Track consecutive failures on the same task. A "failure" is:
|
|
9
|
+
- Test failure after implementation
|
|
10
|
+
- Lint error after fix attempt
|
|
11
|
+
- User correction of the same issue
|
|
12
|
+
- Build failure after code change
|
|
13
|
+
|
|
14
|
+
### Escalation ladder
|
|
15
|
+
|
|
16
|
+
| Attempt | Action |
|
|
17
|
+
| ------- | ------ |
|
|
18
|
+
| 1st failure | Fix the specific error. Re-validate. |
|
|
19
|
+
| 2nd failure (same issue) | Step back. Re-read the relevant code and spec. Try a different approach. |
|
|
20
|
+
| 3rd failure (same issue) | STOP. Report What / So What / Now What. Do not attempt a 4th fix. |
|
|
21
|
+
|
|
22
|
+
This is already in `execution-loop.md` as "Stop-and-Fix Rule." This rule adds
|
|
23
|
+
the structured escalation between attempts.
|
|
24
|
+
|
|
25
|
+
### Strategy rotation on 2nd failure
|
|
26
|
+
When the first fix doesn't work, rotate strategy before retrying:
|
|
27
|
+
|
|
28
|
+
| Failed strategy | Try instead |
|
|
29
|
+
| --------------- | ----------- |
|
|
30
|
+
| Modify existing code | Rewrite the function from scratch |
|
|
31
|
+
| Add logic | Remove logic (simplify) |
|
|
32
|
+
| Fix forward | Revert to last working state, approach differently |
|
|
33
|
+
| Local fix | Check if the problem is upstream (caller, input, config) |
|
|
34
|
+
|
|
35
|
+
### 3rd failure report format
|
|
36
|
+
```
|
|
37
|
+
STOP — REPAIR FAILED
|
|
38
|
+
━━━━━━━━━━━━━━━━━━━━━
|
|
39
|
+
What: {exact error after 3 attempts}
|
|
40
|
+
So What: {root cause hypothesis — why all 3 attempts failed}
|
|
41
|
+
Now What: {recommended next step — different approach, user input, or scope change}
|
|
42
|
+
━━━━━━━━━━━━━━━━━━━━━
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Anti-Patterns — Conventions (WARN on violation)
|
|
46
|
+
|
|
47
|
+
- Do NOT retry the identical fix. If attempt 1 failed, attempt 2 must differ.
|
|
48
|
+
- Do NOT add complexity to fix a failure. If the fix is more complex than the original code, the approach is wrong.
|
|
49
|
+
- Do NOT blame the tooling. If tests fail, the code is likely wrong.
|
|
50
|
+
- Do NOT suppress errors to make validation pass. Fix the root cause.
|
|
51
|
+
|
|
52
|
+
## Removal Condition
|
|
53
|
+
Remove when Claude Code provides native failure tracking and strategy rotation.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Session Bridge — Rules
|
|
2
|
+
# Scope: All projects, all sessions
|
|
3
|
+
# Protocol for session handoff: end-of-session persist + start-of-session rehydrate
|
|
4
|
+
|
|
5
|
+
## End-of-Session Persist — Invariants (BLOCK on violation)
|
|
6
|
+
|
|
7
|
+
### Mandatory writes before session ends
|
|
8
|
+
1. Update `{vault_path}/status.md` with current What / So What / Now What
|
|
9
|
+
2. Update `{vault_path}/claude-progress.json` with session entry
|
|
10
|
+
3. Write session note to `{vault_path}/notes/{YYYY-MM-DD}_session-note.md`
|
|
11
|
+
|
|
12
|
+
These are already enforced by the Stop hook prompt. This rule makes explicit
|
|
13
|
+
that the vault write is the bridge — conversation state that isn't persisted is lost.
|
|
14
|
+
|
|
15
|
+
## Start-of-Session Rehydrate — Conventions (WARN on violation)
|
|
16
|
+
|
|
17
|
+
### Bootstrap sequence (extends After Compaction § in CLAUDE.md)
|
|
18
|
+
1. Read project CLAUDE.md
|
|
19
|
+
2. Read `{vault_path}/status.md` for loop position and current plan
|
|
20
|
+
3. Read active plan file (current milestone only)
|
|
21
|
+
4. Search vault for context relevant to active task: `rg "{task topic}" {vault_path}/specs/ {vault_path}/notes/`
|
|
22
|
+
5. Load rules scoped to the current task's file types
|
|
23
|
+
|
|
24
|
+
## Cross-Session Continuity — Conventions (WARN on violation)
|
|
25
|
+
|
|
26
|
+
### What survives sessions (via vault)
|
|
27
|
+
- Decisions, specs, ADRs → `{vault_path}/specs/`
|
|
28
|
+
- Session summaries → `{vault_path}/notes/`
|
|
29
|
+
- Learnings → `{vault_path}/notes/learnings.md`
|
|
30
|
+
- Task state → `{vault_path}/status.md`, `claude-progress.json`
|
|
31
|
+
- Plan progress → `{vault_path}/plans/`
|
|
32
|
+
|
|
33
|
+
### What does NOT survive sessions
|
|
34
|
+
- Conversation context (volatile — this is by design)
|
|
35
|
+
- File contents read into context (re-read as needed)
|
|
36
|
+
- Subagent outputs (summarize findings into vault if important)
|
|
37
|
+
|
|
38
|
+
## Removal Condition
|
|
39
|
+
Remove when Claude Code provides native cross-session memory persistence.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Session Metrics — Rules
|
|
2
|
+
# Scope: All projects, all sessions
|
|
3
|
+
# Tracks harness-level performance for self-improvement
|
|
4
|
+
|
|
5
|
+
## Metric Collection — Conventions (WARN on violation)
|
|
6
|
+
|
|
7
|
+
### Metrics captured by existing hooks
|
|
8
|
+
The Stop hook and session-data-collect.sh already capture:
|
|
9
|
+
- Session date and timestamp
|
|
10
|
+
- Branch and last commit
|
|
11
|
+
- Accomplishments (via vault prompt)
|
|
12
|
+
- Corrections count (via session-retro)
|
|
13
|
+
- Learn entries count (via session-retro)
|
|
14
|
+
|
|
15
|
+
### Additional metrics to track (when session-retro runs)
|
|
16
|
+
Append these to the session entry in `claude-progress.json`:
|
|
17
|
+
|
|
18
|
+
| Metric | Source | Purpose |
|
|
19
|
+
| ------ | ------ | ------- |
|
|
20
|
+
| `compaction_count` | Count compact checkpoints for today | How often context exhausted |
|
|
21
|
+
| `files_modified` | `git diff --stat` at session end | Session scope indicator |
|
|
22
|
+
| `milestones_completed` | Plan file milestone checkmarks | Throughput indicator |
|
|
23
|
+
| `repair_attempts` | Count repair traces in vault | Code quality signal |
|
|
24
|
+
| `phase_time` | Estimated split across plan/implement/verify | Bottleneck detection |
|
|
25
|
+
|
|
26
|
+
### Metrics directory
|
|
27
|
+
When session-retro produces structured metrics, write to:
|
|
28
|
+
`{vault_path}/metrics/{YYYY-MM-DD}_session-metrics.md`
|
|
29
|
+
|
|
30
|
+
Format:
|
|
31
|
+
```markdown
|
|
32
|
+
---
|
|
33
|
+
tags: [metrics, session]
|
|
34
|
+
date: YYYY-MM-DD
|
|
35
|
+
source: agent
|
|
36
|
+
---
|
|
37
|
+
# Session Metrics — {YYYY-MM-DD}
|
|
38
|
+
|
|
39
|
+
| Metric | Value |
|
|
40
|
+
| ------ | ----- |
|
|
41
|
+
| Milestones completed | {n} |
|
|
42
|
+
| Files modified | {n} |
|
|
43
|
+
| Compactions | {n} |
|
|
44
|
+
| Repair attempts | {n} |
|
|
45
|
+
| Corrections | {n} |
|
|
46
|
+
| Learnings | {n} |
|
|
47
|
+
| Phase split | Plan {n}% / Implement {n}% / Verify {n}% |
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Pattern Detection — Conventions (WARN on violation)
|
|
51
|
+
|
|
52
|
+
After 5+ sessions with metrics, look for:
|
|
53
|
+
- Debugging consistently >40% of session time → suggest architectural review
|
|
54
|
+
- Compaction count >2 per session → suggest smaller task scoping
|
|
55
|
+
- Repair attempts >3 per session → suggest better spec clarity
|
|
56
|
+
- Corrections >2 per session → suggest context reset or rule update
|
|
57
|
+
|
|
58
|
+
Surface patterns in `/px-session-retro` Phase 7 (Session Health Assessment).
|
|
59
|
+
|
|
60
|
+
## Removal Condition
|
|
61
|
+
Remove when Claude Code provides native session analytics and performance tracking.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Skill Authoring — Rules
|
|
2
|
+
# Scope: Creating or editing base/skills/*/SKILL.md files
|
|
3
|
+
# Codifies agent-first skill design principles
|
|
4
|
+
|
|
5
|
+
## Agent-First Principle
|
|
6
|
+
|
|
7
|
+
The agent is the primary reader of every skill. Design decisions optimize for
|
|
8
|
+
how Claude discovers, loads, and executes a skill — not for how a human browses.
|
|
9
|
+
|
|
10
|
+
## SKILL.md Structure — Invariants (BLOCK on violation)
|
|
11
|
+
|
|
12
|
+
### Frontmatter (required)
|
|
13
|
+
```yaml
|
|
14
|
+
---
|
|
15
|
+
name: px-{skill-name}
|
|
16
|
+
disable-model-invocation: true # false only for auto-trigger skills
|
|
17
|
+
description: "{what it does}. {when to use it}."
|
|
18
|
+
---
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Description as discovery API
|
|
22
|
+
The description field is how Claude selects this skill from 40+ candidates.
|
|
23
|
+
|
|
24
|
+
- Write in third person — descriptions are injected into the system prompt
|
|
25
|
+
- Include BOTH what the skill does AND when to activate it
|
|
26
|
+
- Include trigger keywords the user is likely to say
|
|
27
|
+
- Bad: "Helps with infrastructure" (too vague to discover)
|
|
28
|
+
- Good: "Generates Terraform modules for Azure resources. Use when the user asks to create, modify, or scaffold infrastructure."
|
|
29
|
+
|
|
30
|
+
### Body structure
|
|
31
|
+
- Imperative voice — step-by-step, not conversational
|
|
32
|
+
- Flat structure — one level of headings, no deep nesting
|
|
33
|
+
- Every line must change agent behavior or it's dead weight
|
|
34
|
+
- Under 150 lines — skills over 150 lines should split into a skill + reference file
|
|
35
|
+
|
|
36
|
+
## Degrees of Freedom — Conventions (WARN on violation)
|
|
37
|
+
|
|
38
|
+
Calibrate constraint tightness to operation risk:
|
|
39
|
+
|
|
40
|
+
| Freedom | When | Example skills |
|
|
41
|
+
| ------- | ---- | -------------- |
|
|
42
|
+
| High (text guidance) | Multiple valid paths, creative work | px-discuss, px-review |
|
|
43
|
+
| Medium (templates) | Structured output, consistent format | px-plan, px-session-retro |
|
|
44
|
+
| Low (exact scripts) | Destructive ops, security-sensitive | px-ship, px-secret-scan |
|
|
45
|
+
|
|
46
|
+
### Feedback loops
|
|
47
|
+
Non-trivial skills must include a validate → fix → repeat cycle:
|
|
48
|
+
- Produce intermediate artifact
|
|
49
|
+
- Validate it (test, lint, structural check)
|
|
50
|
+
- Iterate until validation passes
|
|
51
|
+
- Verbose error messages so Claude can self-correct
|
|
52
|
+
|
|
53
|
+
## Naming Convention — Conventions (WARN on violation)
|
|
54
|
+
|
|
55
|
+
- Prefix: `px-` for all Praxis skills
|
|
56
|
+
- Format: short verb or noun — `px-verify`, `px-plan`, `px-debug`
|
|
57
|
+
- Not gerunds — slash commands read better as `/px-verify` than `/px-verifying`
|
|
58
|
+
- Kit skills: `{kit-prefix}:{action}` — `/infra:plan`, `/kg:query`
|
|
59
|
+
|
|
60
|
+
## Boundaries Section — Conventions (WARN on violation)
|
|
61
|
+
|
|
62
|
+
Every skill with side effects must include a `## Boundaries` section:
|
|
63
|
+
- What is explicitly out of scope
|
|
64
|
+
- What the skill must NOT modify
|
|
65
|
+
- Maximum attempts before escalation
|
|
66
|
+
- Whether user approval is required for destructive actions
|
|
67
|
+
|
|
68
|
+
## Progressive Disclosure — Conventions (WARN on violation)
|
|
69
|
+
|
|
70
|
+
- SKILL.md is the entry point — keep it under 150 lines
|
|
71
|
+
- Additional context in reference files one level deep from SKILL.md
|
|
72
|
+
- Prefer executing scripts over reading them into context
|
|
73
|
+
- Name files for content, not sequence: `validation_rules.md` not `doc2.md`
|
|
74
|
+
|
|
75
|
+
## Testing New Skills
|
|
76
|
+
|
|
77
|
+
1. Write the skill
|
|
78
|
+
2. Load it in a fresh session (Claude B)
|
|
79
|
+
3. Invoke with a realistic prompt
|
|
80
|
+
4. Check: Did Claude discover it? Execute it correctly? Follow boundaries?
|
|
81
|
+
5. Tighten constraints where Claude diverged from intent
|
|
82
|
+
|
|
83
|
+
## Removal Condition
|
|
84
|
+
Remove when Claude Code provides a native skill authoring wizard with
|
|
85
|
+
built-in agent-first validation.
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Writing Quality — Prose Generation Constraints
|
|
2
|
+
# Scope: All prose output — design docs, ADRs, READMEs, specs, PR descriptions,
|
|
3
|
+
# commit messages, code comments, status reports
|
|
4
|
+
# Always active during prose generation
|
|
5
|
+
|
|
6
|
+
## The Prime Directive for Prose
|
|
7
|
+
Write for the engineer reading this at 11pm during an incident.
|
|
8
|
+
They have 90 seconds. Every word must earn its place.
|
|
9
|
+
|
|
10
|
+
## Invariants — BLOCK on violation
|
|
11
|
+
|
|
12
|
+
### Sentence limits
|
|
13
|
+
- Maximum 30 words per sentence. Count before writing long sentences.
|
|
14
|
+
- Maximum 5 sentences per paragraph.
|
|
15
|
+
- One idea per paragraph.
|
|
16
|
+
|
|
17
|
+
### Fluff kill list — never write these words or phrases
|
|
18
|
+
leverage (use: use), utilize (use: use), facilitate (use: enable, allow, help),
|
|
19
|
+
moving forward, going forward, at this point in time, comprehensive solution,
|
|
20
|
+
robust solution, seamlessly, cutting-edge, best-in-class,
|
|
21
|
+
in order to (use: to), due to the fact that (use: because),
|
|
22
|
+
at the end of the day, synergy, holistic, empower, streamline
|
|
23
|
+
|
|
24
|
+
For additional banned AI-filler phrases, see `px-communication-standards` skill.
|
|
25
|
+
That skill covers: "Certainly!", "Absolutely!", "Great question!", "I'd be happy to",
|
|
26
|
+
"It's worth noting that", "In conclusion", "To summarize the above".
|
|
27
|
+
Both lists are enforced. Neither is optional.
|
|
28
|
+
|
|
29
|
+
### Voice on decisions
|
|
30
|
+
- Active voice on decisions: "we decided" not "it was decided"
|
|
31
|
+
- Active voice on architecture: "this service handles X" not "X is handled by"
|
|
32
|
+
- Reserve passive voice for describing states: "the cache is invalidated when..."
|
|
33
|
+
|
|
34
|
+
### Hedging on decided things
|
|
35
|
+
- Decided things use "will", not "should" or "might"
|
|
36
|
+
- Uncertain things are labeled explicitly: "open question:", "to be decided:"
|
|
37
|
+
- Never hedge silently. If you are uncertain, say so.
|
|
38
|
+
|
|
39
|
+
## Document Structure — Mandatory Templates
|
|
40
|
+
|
|
41
|
+
### Design Doc (filename: DESIGN-*.md or *-design.md)
|
|
42
|
+
Required sections — none optional, none empty:
|
|
43
|
+
|
|
44
|
+
#### Problem
|
|
45
|
+
- What is broken, missing, or painful? Past tense. Specific.
|
|
46
|
+
- "The auth service does not rate-limit failed login attempts" — GOOD
|
|
47
|
+
- "We need better authentication" — BAD (not specific, not a problem statement)
|
|
48
|
+
|
|
49
|
+
#### Decision
|
|
50
|
+
- What are we building? Active voice. One paragraph.
|
|
51
|
+
- State what this is AND what it is NOT (explicit scope boundary).
|
|
52
|
+
|
|
53
|
+
#### Tradeoffs
|
|
54
|
+
- Minimum 2 items. For each: what we gain AND what we give up.
|
|
55
|
+
- Not "pros and cons of the overall approach" — tradeoffs of THIS decision vs alternatives.
|
|
56
|
+
|
|
57
|
+
#### Acceptance Criteria
|
|
58
|
+
- Verifiable statements. Observable outcomes. Present tense.
|
|
59
|
+
- GOOD: "The login endpoint returns 429 after 5 failed attempts within 60 seconds"
|
|
60
|
+
- BAD: "The system handles failed logins correctly"
|
|
61
|
+
- BAD: "Improved security posture"
|
|
62
|
+
|
|
63
|
+
### ADR (filename: ADR-NNN-*.md)
|
|
64
|
+
Required fields in this order:
|
|
65
|
+
```
|
|
66
|
+
# ADR-NNN: {title}
|
|
67
|
+
Status: Proposed | Accepted | Deprecated | Superseded by ADR-NNN
|
|
68
|
+
Date: YYYY-MM-DD
|
|
69
|
+
|
|
70
|
+
## Context
|
|
71
|
+
{past tense — what situation forced this decision}
|
|
72
|
+
|
|
73
|
+
## Decision
|
|
74
|
+
{active voice — what we decided}
|
|
75
|
+
|
|
76
|
+
## Consequences
|
|
77
|
+
### Positive
|
|
78
|
+
- {at least one}
|
|
79
|
+
### Negative
|
|
80
|
+
- {at least one — if no negatives, the decision is not analyzed}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### README (filename: README.md)
|
|
84
|
+
Required sections:
|
|
85
|
+
- First paragraph: what does this do (3 sentences max, no jargon)
|
|
86
|
+
- `## Install` or `## Setup` with exact commands
|
|
87
|
+
- `## Run` with exact commands — no `{placeholder}` in code blocks
|
|
88
|
+
- `## Test` with exact commands
|
|
89
|
+
|
|
90
|
+
### PR Description
|
|
91
|
+
Required sections:
|
|
92
|
+
- **What**: one sentence — what changed
|
|
93
|
+
- **Why**: one sentence — why this was needed
|
|
94
|
+
- **How to verify**: exact steps a reviewer takes to confirm it works
|
|
95
|
+
- **Breaking changes**: explicit "None" if none — do not omit
|
|
96
|
+
|
|
97
|
+
## Commit Messages
|
|
98
|
+
Format: `{type}({scope}): {what changed in imperative mood}`
|
|
99
|
+
|
|
100
|
+
Types: feat, fix, refactor, test, docs, chore, perf, ci
|
|
101
|
+
Scope: the module, package, or subsystem changed
|
|
102
|
+
Subject: present tense imperative — "add retry logic" not "added retry logic"
|
|
103
|
+
|
|
104
|
+
50-char subject limit. 72-char body line limit if body is present.
|
|
105
|
+
Body explains WHY the change was needed, not what the diff shows.
|
|
106
|
+
|
|
107
|
+
## Code Comments
|
|
108
|
+
- WHY not WHAT. The code shows what.
|
|
109
|
+
- GOOD: `// retry 3x — upstream returns 503 on cold start, recovers within 2s`
|
|
110
|
+
- BAD: `// increment counter`
|
|
111
|
+
- Zero tolerance for TODO/FIXME/HACK in committed code.
|
|
112
|
+
Use `// QUALITY: {issue} — tracked in #{issue-number}` if deferring.
|
|
113
|
+
See `refactor-triggers.md` for the QUALITY comment convention.
|
|
114
|
+
|
|
115
|
+
## Cross-References
|
|
116
|
+
- Document-level formatting (proposals, status reports, executive summaries): see `px-communication-standards` skill
|
|
117
|
+
- Commit standards and git workflow: see `git-workflow.md`
|
|
118
|
+
- Code comment rules: see `code-quality.md` § On comments
|
|
119
|
+
|
|
120
|
+
## Removal Condition
|
|
121
|
+
Remove when a prose linter (Vale or equivalent) runs as a generation-time hook
|
|
122
|
+
on all markdown and prose output.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: px-compact
|
|
3
|
+
disable-model-invocation: true
|
|
4
|
+
description: "Intelligent mid-session compaction. Triages context, checkpoints to vault, triggers compact, reloads working set. Use when DEPLETED but mid-milestone — no /clear needed."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# compact Skill
|
|
8
|
+
|
|
9
|
+
You are performing an intelligent mid-session compaction to free context budget
|
|
10
|
+
while preserving the active working set.
|
|
11
|
+
|
|
12
|
+
**Key difference from `/px-context-reset`:** No `/clear` required. You stay in the
|
|
13
|
+
same session and resume immediately after compaction.
|
|
14
|
+
|
|
15
|
+
## Vault Path Resolution
|
|
16
|
+
|
|
17
|
+
Read vault_path from `~/.claude/praxis.config.json`.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
**Step 1 — Pre-flight check**
|
|
22
|
+
|
|
23
|
+
Assess context bracket from signals (see `context-budget.md` § Budget signals):
|
|
24
|
+
|
|
25
|
+
- **FRESH** → Print: "Context is still fresh. Compaction would lose more than it saves." → STOP.
|
|
26
|
+
- **CRITICAL with no active milestone** → Print: "Context is critically degraded with no active milestone. Use `/px-context-reset` + `/clear` instead." → STOP.
|
|
27
|
+
- **MODERATE/DEPLETED/CRITICAL with active milestone** → Continue.
|
|
28
|
+
|
|
29
|
+
**Step 2 — Triage context**
|
|
30
|
+
|
|
31
|
+
Classify all loaded context into priority tiers:
|
|
32
|
+
|
|
33
|
+
| Tier | Action |
|
|
34
|
+
| ---- | ------ |
|
|
35
|
+
| T1: Active working set (current file, active milestone, failing tests) | Keep — reload after compact |
|
|
36
|
+
| T2: Decision context (SPEC, constraints, last 3 decisions) | Keep — include in checkpoint |
|
|
37
|
+
| T3: Session history (earlier discussion, exploration, superseded approaches) | Offload summaries to vault |
|
|
38
|
+
| T4: Reference material (docs consumed, examples applied) | Drop |
|
|
39
|
+
|
|
40
|
+
For T3 items with decision value: append summaries to `{vault_path}/plans/{YYYY-MM-DD}-triage-offload.md`.
|
|
41
|
+
|
|
42
|
+
**Step 3 — Write compact checkpoint**
|
|
43
|
+
|
|
44
|
+
Write `{vault_path}/plans/{YYYY-MM-DD}-compact-checkpoint.md`:
|
|
45
|
+
|
|
46
|
+
```markdown
|
|
47
|
+
---
|
|
48
|
+
tags: [checkpoint, compact, triage]
|
|
49
|
+
date: {YYYY-MM-DD}
|
|
50
|
+
source: agent
|
|
51
|
+
---
|
|
52
|
+
# Compact Checkpoint — {YYYY-MM-DD HH:MM}
|
|
53
|
+
|
|
54
|
+
## Active Working Set (reload after compact)
|
|
55
|
+
- File: {path} — {what you are doing with it}
|
|
56
|
+
- File: {path} — {what you are doing with it}
|
|
57
|
+
|
|
58
|
+
## Current Milestone
|
|
59
|
+
{milestone name from active plan}
|
|
60
|
+
|
|
61
|
+
## Decisions (last 3)
|
|
62
|
+
1. {decision} — {rationale}
|
|
63
|
+
2. {decision} — {rationale}
|
|
64
|
+
3. {decision} — {rationale}
|
|
65
|
+
|
|
66
|
+
## Offloaded This Session
|
|
67
|
+
See: plans/{YYYY-MM-DD}-triage-offload.md
|
|
68
|
+
|
|
69
|
+
## Next Step After Compact
|
|
70
|
+
{exact next action — be specific}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Step 4 — Update vault state**
|
|
74
|
+
|
|
75
|
+
1. Update `{vault_path}/status.md` — refresh What / So What / Now What
|
|
76
|
+
2. Update `{vault_path}/claude-progress.json` — add session entry with `"source": "compact"`
|
|
77
|
+
|
|
78
|
+
**Step 5 — Trigger compaction**
|
|
79
|
+
|
|
80
|
+
Print the bootstrap instructions first:
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
Compact checkpoint saved. Triggering compaction.
|
|
84
|
+
|
|
85
|
+
After compaction, re-bootstrap:
|
|
86
|
+
1. Read {vault_path}/plans/{YYYY-MM-DD}-compact-checkpoint.md
|
|
87
|
+
2. Read the active plan: {plan-filename}, milestone: {milestone-name}
|
|
88
|
+
3. Re-read only files listed in "Active Working Set" above
|
|
89
|
+
4. Resume: {next step}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Then run `/compact` (Claude Code built-in).
|
|
93
|
+
|
|
94
|
+
**Note:** The PreCompact hook (`vault-checkpoint.sh`) will also fire and write its own
|
|
95
|
+
checkpoint. The triage checkpoint from Step 3 is authoritative — it contains the
|
|
96
|
+
curated working set. The hook checkpoint is a safety net.
|
|
97
|
+
|
|
98
|
+
## Removal Condition
|
|
99
|
+
|
|
100
|
+
Remove when Claude Code provides native intelligent compaction with working set preservation.
|