@mohammadhprp/system-prompt 0.11.0 → 0.11.2

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 (97) hide show
  1. package/framework/agents/backend-architect.md +1 -1
  2. package/framework/commands/commit.md +0 -3
  3. package/framework/mcps/figma-mcp-go/README.md +0 -1
  4. package/framework/mcps/gitlab-mcp/README.md +0 -1
  5. package/framework/mcps/jira-mcp/README.md +0 -1
  6. package/framework/mcps/laravel-boost/README.md +0 -1
  7. package/framework/mcps/notion-mcp/README.md +0 -1
  8. package/framework/mcps/supabase-mcp/README.md +0 -1
  9. package/framework/plugins/opencode-goal-plugin/README.md +0 -1
  10. package/framework/references/standards/api.md +0 -1
  11. package/framework/references/standards/architecture.md +0 -1
  12. package/framework/references/standards/database.md +0 -1
  13. package/framework/references/standards/debugging.md +0 -1
  14. package/framework/references/standards/documentation.md +0 -2
  15. package/framework/references/standards/logging.md +0 -1
  16. package/framework/references/standards/naming.md +0 -1
  17. package/framework/references/standards/observability.md +0 -1
  18. package/framework/references/standards/performance.md +0 -1
  19. package/framework/references/standards/pull-requests.md +0 -1
  20. package/framework/references/standards/security.md +0 -1
  21. package/framework/references/standards/testing.md +0 -1
  22. package/framework/skills/README.md +15 -3
  23. package/framework/skills/codenavi/SKILL.md +306 -0
  24. package/framework/skills/codenavi/examples.md +33 -0
  25. package/framework/skills/codenavi/references/coding-principles.md +143 -0
  26. package/framework/skills/codenavi/references/notebook-spec.md +171 -0
  27. package/framework/skills/create-adr/SKILL.md +429 -0
  28. package/framework/skills/create-adr/examples.md +35 -0
  29. package/framework/skills/docs-writer/SKILL.md +39 -0
  30. package/framework/skills/docs-writer/examples.md +34 -0
  31. package/framework/skills/docs-writer/references/style-guide.md +72 -0
  32. package/framework/skills/frontend-design/SKILL.md +55 -0
  33. package/framework/skills/frontend-design/examples.md +45 -0
  34. package/framework/skills/humanizer/SKILL.md +412 -0
  35. package/framework/skills/humanizer/examples.md +46 -0
  36. package/framework/skills/learning-opportunities/SKILL.md +140 -0
  37. package/framework/skills/learning-opportunities/examples.md +34 -0
  38. package/framework/skills/learning-opportunities/references/PRINCIPLES.md +42 -0
  39. package/framework/skills/perf-web-optimization/SKILL.md +163 -0
  40. package/framework/skills/perf-web-optimization/examples.md +35 -0
  41. package/framework/skills/perf-web-optimization/references/bundle-optimization.md +180 -0
  42. package/framework/skills/perf-web-optimization/references/core-web-vitals.md +154 -0
  43. package/framework/skills/perf-web-optimization/references/image-optimization.md +170 -0
  44. package/framework/skills/security-best-practices/LICENSE.txt +201 -0
  45. package/framework/skills/security-best-practices/SKILL.md +89 -0
  46. package/framework/skills/security-best-practices/examples.md +35 -0
  47. package/framework/skills/security-best-practices/references/golang-general-backend-security.md +988 -0
  48. package/framework/skills/security-best-practices/references/javascript-express-web-server-security.md +1151 -0
  49. package/framework/skills/security-best-practices/references/javascript-general-web-frontend-security.md +725 -0
  50. package/framework/skills/security-best-practices/references/javascript-jquery-web-frontend-security.md +672 -0
  51. package/framework/skills/security-best-practices/references/javascript-typescript-nextjs-web-server-security.md +1138 -0
  52. package/framework/skills/security-best-practices/references/javascript-typescript-react-web-frontend-security.md +975 -0
  53. package/framework/skills/security-best-practices/references/javascript-typescript-vue-web-frontend-security.md +789 -0
  54. package/framework/skills/security-best-practices/references/python-django-web-server-security.md +880 -0
  55. package/framework/skills/security-best-practices/references/python-fastapi-web-server-security.md +1030 -0
  56. package/framework/skills/security-best-practices/references/python-flask-web-server-security.md +835 -0
  57. package/framework/skills/sentry/SKILL.md +127 -0
  58. package/framework/skills/sentry/examples.md +34 -0
  59. package/framework/skills/sentry/scripts/sentry_api.py +238 -0
  60. package/framework/skills/show-me/SKILL.md +127 -0
  61. package/framework/skills/show-me/examples.md +78 -0
  62. package/framework/skills/spec-driven-eval/SKILL.md +341 -0
  63. package/framework/skills/spec-driven-eval/examples.md +35 -0
  64. package/framework/skills/spec-driven-eval/references/quickstart.md +118 -0
  65. package/framework/skills/spec-driven-eval/references/reference.md +295 -0
  66. package/framework/skills/technical-design-doc-creator/README.md +411 -0
  67. package/framework/skills/technical-design-doc-creator/SKILL.md +1484 -0
  68. package/framework/skills/technical-design-doc-creator/examples.md +35 -0
  69. package/framework/skills/tlc-spec-driven/SKILL.md +184 -0
  70. package/framework/skills/tlc-spec-driven/examples.md +34 -0
  71. package/framework/skills/tlc-spec-driven/references/code-analysis.md +98 -0
  72. package/framework/skills/tlc-spec-driven/references/coding-principles.md +72 -0
  73. package/framework/skills/tlc-spec-driven/references/context-limits.md +31 -0
  74. package/framework/skills/tlc-spec-driven/references/design.md +199 -0
  75. package/framework/skills/tlc-spec-driven/references/discuss.md +159 -0
  76. package/framework/skills/tlc-spec-driven/references/implement.md +436 -0
  77. package/framework/skills/tlc-spec-driven/references/lessons.md +115 -0
  78. package/framework/skills/tlc-spec-driven/references/memory.md +144 -0
  79. package/framework/skills/tlc-spec-driven/references/specify.md +228 -0
  80. package/framework/skills/tlc-spec-driven/references/sub-agents.md +147 -0
  81. package/framework/skills/tlc-spec-driven/references/tasks.md +451 -0
  82. package/framework/skills/tlc-spec-driven/references/validate.md +355 -0
  83. package/framework/skills/tlc-spec-driven/scripts/check_commit.py +115 -0
  84. package/framework/skills/tlc-spec-driven/scripts/lessons.py +412 -0
  85. package/framework/skills/tlc-spec-driven/scripts/validate_spec.py +260 -0
  86. package/framework/skills/tlc-spec-driven/scripts/validate_state.py +162 -0
  87. package/framework/skills/tlc-spec-driven/scripts/validate_tasks.py +251 -0
  88. package/framework/skills/web-design-guidelines/SKILL.md +65 -0
  89. package/framework/skills/web-design-guidelines/examples.md +32 -0
  90. package/framework/skills/web-design-guidelines/references/guideline.md +174 -0
  91. package/package.json +1 -1
  92. package/src/catalog.js +15 -3
  93. package/src/installer.js +66 -1
  94. package/framework/skills/backend-engineer/SKILL.md +0 -76
  95. package/framework/skills/backend-engineer/examples.md +0 -31
  96. package/framework/skills/documentation/SKILL.md +0 -74
  97. package/framework/skills/documentation/examples.md +0 -31
@@ -0,0 +1,35 @@
1
+ # Technical Design Doc Creator Examples
2
+
3
+ ## Payment integration design doc
4
+
5
+ User: "Create a TDD for integrating Stripe payments into our subscription system."
6
+
7
+ Good agent behavior:
8
+
9
+ - Ask about project size and type before generating, then size the document to the answer.
10
+ - Detect the user's language and generate all headers and prose in it.
11
+ - Enforce the mandatory sections: problem statement, scope, technical solution, risks, and implementation plan.
12
+ - Make the Security section mandatory because this is a payment system, and collect PCI DSS, encryption, and PII handling details.
13
+ - Keep the document at the architectural level: API contracts, data flow, and rollback strategy, not CLI commands or code snippets.
14
+
15
+ ## Small feature design doc
16
+
17
+ User: "Write a design doc for adding user profile pictures."
18
+
19
+ Good agent behavior:
20
+
21
+ - Recognize this as a small feature and produce a streamlined TDD with only the essential sections.
22
+ - Ask for the basic information needed: problem statement, scope, and technical approach.
23
+ - Include an implementation plan with owner, status, and estimate columns.
24
+ - Skip suggested sections like Migration Plan and Approval when they don't apply.
25
+
26
+ ## Migrating a database
27
+
28
+ User: "Crie um TDD para migração do banco de dados PostgreSQL para MongoDB"
29
+
30
+ Good agent behavior:
31
+
32
+ - Detect Portuguese and generate the TDD in Portuguese with translated section headers.
33
+ - Identify this as a data migration project and add a migration plan covering strategy, phases, and rollback.
34
+ - Ask for the migration strategy, data mapping, and rollback plan before writing.
35
+ - Note data integrity validation as a first-class concern rather than an afterthought.
@@ -0,0 +1,184 @@
1
+ ---
2
+ name: tlc-spec-driven
3
+ description: Feature planning and implementation with 4 adaptive phases (Specify, Design, Tasks, Execute). Auto-sizes depth by complexity. Writes testable requirements in EARS notation, atomic tasks, atomic Conventional Commits, and requirement traceability. Ships deterministic Python validation scripts so structural gates are enforced by code, not memory. Features an independent Verifier (author != verifier, evidence-or-zero), a discrimination sensor, a decision log (STATE.md), a test-coverage matrix, and a self-improving lessons layer. Stack-agnostic and tool-agnostic. Use when (1) planning features, (2) implementing with verification and atomic commits, (3) validating an implementation against a spec. Triggers on "specify feature", "discuss feature", "design", "tasks", "implement", "validate", "verify work", "UAT", "record decision", "pause work", "resume work". Do NOT use for pure architecture decomposition analysis or standalone technical design documents.
4
+ license: CC-BY-4.0
5
+ metadata:
6
+ author: Felipe Rodrigues - github.com/felipfr
7
+ version: 3.3.0
8
+ ---
9
+
10
+ # Tech Lead's Club - Spec-Driven Development
11
+
12
+ Plan and implement features with precision. Granular tasks. Clear dependencies. Right tools. Zero ceremony.
13
+
14
+ ```
15
+ ┌──────────┐ ┌──────────┐ ┌─────────┐ ┌─────────┐
16
+ │ SPECIFY │ → │ DESIGN │ → │ TASKS │ → │ EXECUTE │
17
+ └──────────┘ └──────────┘ └─────────┘ └─────────┘
18
+ required optional* optional* required
19
+
20
+ * Agent auto-skips when scope doesn't need it
21
+ ```
22
+
23
+ ## Critical Rules (read before acting)
24
+
25
+ **Loading this skill's files.** Reference files live under `references/` in this skill's own directory (where this `SKILL.md` resides). Resolve them relative to the skill directory - never the workspace root - and load them through the active skill by name; never assume a fixed install path. When a step tells you to read a reference, **read it completely (to EOF)** before acting - never act on a partial/truncated read.
26
+
27
+ **Running this skill's scripts.** Every `scripts/*.py` shipped with this skill lives under that same skill directory. Resolve the skill directory first, then invoke `python3 <skill-dir>/scripts/<name>.py ...`. Never run `python3 scripts/...` from the consuming project root - that looks for a project-local `scripts/` tree that is not this skill. Project data under `.specs/` is still read/written relative to the project root (pass `--root` when the cwd is elsewhere). Below, `<skill-dir>` means the directory that contains this `SKILL.md`.
28
+
29
+ **Execution contract - every task, non-negotiable (holds even if you do not open the reference files):**
30
+
31
+ 1. Tests derive from the spec's acceptance criteria and assert spec-defined outcomes - they never mirror the implementation.
32
+ 2. The gate must pass (tests pass) before a task is done - the test runner decides, not self-assessment.
33
+ 3. One atomic commit per task. Mark the task complete in `tasks.md` (and update spec traceability when used) **before** that commit, and include those updates in the same commit. Never batch tasks; never weaken, skip, or delete tests to make them pass.
34
+ 4. After the LAST task, a fresh **Verifier always runs automatically** (author ≠ verifier) - spec-anchored outcome check + discrimination sensor. It is never optional and never prompted. See Sub-Agent Delegation.
35
+ 5. **Blast radius:** approving a spec or tasks authorizes local implementation and local commits only. `git push`, force-push, deploy, production DB changes, and other remote / externally visible / destructive operations require an explicit go-ahead for that action.
36
+
37
+ **Deterministic gates run before human review - not from memory.** The structural gates for the spec and tasks are enforced by scripts in this skill's `scripts/` directory, so they cannot silently drift when the model forgets a step:
38
+
39
+ - Before confirming a spec: `python3 <skill-dir>/scripts/validate_spec.py <spec-path-or-feature>` (closure gate: EARS-shaped ACs, filled assumptions, well-formed requirement IDs, required sections).
40
+ - Before presenting tasks for approval: `python3 <skill-dir>/scripts/validate_tasks.py <tasks-path-or-feature>` (granularity smell, diagram-vs-`Depends on` parity within a phase, no forward-phase dependency, every task carries `Tests` + `Gate`).
41
+ - On each commit: `python3 <skill-dir>/scripts/check_commit.py --message "<msg>"` (Conventional Commits). Optionally wire it as a git `commit-msg` guard (git only, no agent dependency) - see [implement.md](references/implement.md).
42
+ - Before declaring a feature done: `python3 <skill-dir>/scripts/validate_state.py <feature>` (completion gate: the Verifier's `validation.md` exists, its verdict is filled to PASS, and it cites `file:line` evidence - a missing, FAIL, placeholder, or evidence-free report fails). The closing step of Execute runs this automatically, the same way the lessons layer runs at distillation; it is not a manual step.
43
+
44
+ A non-zero exit means STOP and fix before proceeding. Skip a script only when no code-execution tool is available; then perform the same checks by reading the artifact.
45
+
46
+ **Before Execute:** read [implement.md](references/implement.md) completely and run `<skill-dir>/scripts/validate_tasks.py`; if a formal `tasks.md` packs into more than one task-budgeted batch (> ~8 tasks), present the sub-agent offer first (see Sub-Agent Delegation).
47
+
48
+ ## Auto-Sizing: The Core Principle
49
+
50
+ **The complexity determines the depth, not a fixed pipeline.** Before starting any feature, assess its scope and apply only what's needed:
51
+
52
+ | Scope | What | Specify | Design | Tasks | Execute |
53
+ | ----------- | ------------------------ | ------------------------------------------------------- | ----------------------------------------------- | ----------------------------- | ----------------------------------------------------- |
54
+ | **Small** | ≤3 files, one sentence | One-liner spec (inline) | Skip | Skip | Implement + verify inline |
55
+ | **Medium** | Clear feature, <10 tasks | Spec (brief) | Skip - design inline | Skip - tasks implicit | Implement + verify |
56
+ | **Large** | Multi-component feature | Full spec + requirement IDs | Architecture + components | Full breakdown + dependencies | Implement + verify per task |
57
+ | **Complex** | Ambiguity, new domain | Full spec + [discuss gray areas](references/discuss.md) | [Research](references/design.md) + architecture | Breakdown + phase plan | Implement + [interactive UAT](references/validate.md) |
58
+
59
+ **Rules:**
60
+
61
+ - **Specify and Execute are always required** - you always need to know WHAT and DO it
62
+ - **Design is skipped** when the change is straightforward (no architectural decisions, no new patterns)
63
+ - **Tasks is skipped** when there are ≤3 obvious steps (they become implicit in Execute)
64
+ - **Discuss is triggered within Specify** when the agent detects ambiguous gray areas that need user input, or when the feature has any implicit-requirement dimension present (persistence/state, external calls, auth, payments, concurrency, state transitions)
65
+ - **Interactive UAT is triggered within Execute** only for user-facing features with complex behavior
66
+
67
+ **Safety valve:** Even when Tasks is skipped, Execute ALWAYS starts by listing atomic steps inline (see [implement.md](references/implement.md)). If that listing reveals >5 steps or complex dependencies, STOP and create a formal `tasks.md` - the Tasks phase was wrongly skipped.
68
+
69
+ ## .specs Structure
70
+
71
+ ```
72
+ .specs/
73
+ ├── STATE.md # Project memory: Decisions log (AD-NNN) + Handoff snapshot
74
+ ├── LESSONS.md # Self-improving lessons playbook (rendered by scripts/lessons.py - do not hand-edit)
75
+ ├── lessons.json # Canonical lessons state (machine-owned)
76
+ └── features/ # Feature specifications
77
+ └── [feature]/
78
+ ├── spec.md # Requirements with traceable IDs
79
+ ├── context.md # User decisions for gray areas (only when discuss is triggered)
80
+ ├── design.md # Architecture & components (only for Large/Complex)
81
+ ├── tasks.md # Atomic tasks with verification (only for Large/Complex)
82
+ └── validation.md # Verifier report: PASS/FAIL, per-AC evidence, sensor result, diff range
83
+ ```
84
+
85
+ **Create artifacts lazily.** Write each file only when its phase actually produces content - never scaffold empty `context.md`, `design.md`, or `tasks.md` up front. An empty file signals a phase happened when it did not; absence is the correct state for a skipped phase. The deterministic validators (`scripts/validate_spec.py`, `scripts/validate_tasks.py`, `scripts/check_commit.py`, `scripts/validate_state.py`) ship inside this skill's own `scripts/` directory, alongside `lessons.py`.
86
+
87
+ ## Workflow
88
+
89
+ **New feature:**
90
+
91
+ 1. Specify → (Design) → (Tasks) → Execute (depth auto-sized)
92
+
93
+ **Resume work:**
94
+
95
+ 1. Read `.specs/STATE.md` (Handoff + Decisions).
96
+ 2. Reconcile Handoff against git (`branch`, `status --porcelain`, recent commits) and `tasks.md` - evidence wins over a stale snapshot. Full procedure: [memory.md](references/memory.md).
97
+ 3. Propose the reconciled next step before writing code.
98
+
99
+ ## Context Loading Strategy
100
+
101
+ **On-demand load (only what the current task needs):**
102
+
103
+ - `.specs/STATE.md` - Decisions section (read at Design, re-read on resume); Handoff section (read on resume only)
104
+ - confirmed lessons - load at Specify and Design via `python3 <skill-dir>/scripts/lessons.py list --status confirmed` ([lessons.md](references/lessons.md)); confirmed only, never candidates
105
+ - spec.md (when working on a specific feature)
106
+ - context.md (when designing or implementing from user decisions)
107
+ - design.md (when implementing from design)
108
+ - tasks.md (when executing tasks)
109
+
110
+ **Never load simultaneously:**
111
+
112
+ - Multiple feature specs
113
+ - Multiple architecture docs
114
+
115
+ **Target:** <40k tokens total context
116
+ **Reserve:** 160k+ tokens for work, reasoning, outputs
117
+ **Monitoring:** Display status when >40k (see [context-limits.md](references/context-limits.md))
118
+
119
+ ## Sub-Agent Delegation
120
+
121
+ **Trigger:** count total tasks. If the feature packs into more than one task-budgeted batch (> ~8 tasks) → offer sub-agents; if it fits a single batch (≤ ~8 tasks) → execute inline.
122
+
123
+ **Offer-then-confirm** - never auto-spawn. The user must accept before any sub-agent is dispatched.
124
+
125
+ **One worker per task-budgeted batch (~7 tasks, whole phases):** Phases stay the semantic/dependency unit; a **batch** is the execution unit - one or more *consecutive whole phases* packed to ~7 tasks. Walk phases in order, accumulate whole phases into the current batch until it reaches the budget, then start the next - **never split a phase** across workers. ~20 tasks → ~3 workers; scales linearly (40 → ~6). Each worker executes all its tasks in order (implement → gate → atomic commit), then reports a compact summary (tasks done, commit hashes, test counts, deviations). Batches run sequentially - a batch never starts until the previous one reports all tasks complete. Workers never spawn further sub-agents.
126
+
127
+ **Verifier (always-on, never prompted):** After the final task is committed, the orchestrator dispatches a fresh Verifier sub-agent automatically - regardless of phase count. Validation never requires a user prompt; it is the closing step of Execute. **Author ≠ verifier**: the Verifier re-derives coverage independently using evidence-or-zero; it does not inherit the author's mental model. The Verifier: (1) performs a **spec-anchored outcome check** - confirms each test's asserted value matches the spec-defined expected outcome, flags spec-precision gaps; (2) runs a **discrimination sensor** - injects behavior-level faults in an isolated scratch (temp worktree or file copies - never `git stash`), confirms tests kill them, discards the scratch and verifies real-tree porcelain matches the pre-sensor baseline; surviving mutants become fix tasks; (3) writes `.specs/features/[feature]/validation.md` (PASS/FAIL, per-AC evidence, sensor result, diff range); (4) returns a compact verdict + ranked gap list to the orchestrator in chat. Gaps become fix tasks; the fix→re-verify loop is bounded to 3 iterations before escalating. (5) **distills lessons** - turns each grounded failure (surviving mutant, spec-precision gap, failed AC, SPEC_DEVIATION) into a reusable project-local lesson via `<skill-dir>/scripts/lessons.py`; a clean PASS records nothing (see [lessons.md](references/lessons.md)).
128
+
129
+ **Model tier per role (only if the harness supports choosing a model per sub-agent).** Match the reasoning cost to the work instead of paying top-tier reasoning for boilerplate. A batch worker on a mechanical, low-ambiguity phase (entities, config, wiring, straightforward CRUD) runs on a faster/cheaper tier; a worker on a core-domain or high-ambiguity phase, and the Design phase itself, runs on a high-reasoning tier; the Verifier runs on a mid-to-high tier because it does adversarial reasoning and designs mutations. This is a portable recommendation: if the harness cannot set a per-sub-agent model, ignore it. Full rubric in [sub-agents.md](references/sub-agents.md).
130
+
131
+ **Standalone fallback:** Without sub-agents, run `validate.md` as an independent fresh-eyes pass after the final commit - including the spec-anchored check and discrimination sensor.
132
+
133
+ Full mechanics (worker payload, compact summary format, failure handling, context sizing, model tier, Verifier report format): [sub-agents.md](references/sub-agents.md).
134
+
135
+ ## Commands
136
+
137
+ **Feature-level (auto-sized):**
138
+ | Trigger Pattern | Reference |
139
+ |----------------|-----------|
140
+ | Specify feature, define requirements | [specify.md](references/specify.md) |
141
+ | Discuss feature, capture context, how should this work | [discuss.md](references/discuss.md) |
142
+ | Design feature, architecture | [design.md](references/design.md) |
143
+ | Break into tasks, create tasks | [tasks.md](references/tasks.md) |
144
+ | Implement task, build, execute | [implement.md](references/implement.md) |
145
+ | Validate, verify, test, UAT, walk me through it | [validate.md](references/validate.md) |
146
+
147
+ **Memory:**
148
+ | Trigger Pattern | Reference |
149
+ |----------------|-----------|
150
+ | Record decision, this is a project-level decision | [memory.md](references/memory.md) |
151
+ | Pause work, end session, I need to stop | [memory.md](references/memory.md) |
152
+ | Resume work, continue, pick up where we left off | [memory.md](references/memory.md) |
153
+ | Load lessons, what have we learned, apply past lessons | [lessons.md](references/lessons.md) |
154
+ | Record lesson, distill lessons (auto-runs after validation) | [lessons.md](references/lessons.md) |
155
+
156
+ ## Knowledge Verification Chain
157
+
158
+ When researching, designing, or making any technical decision, follow this chain in strict order. Never skip steps.
159
+
160
+ ```
161
+ Step 1: Codebase → check existing code, conventions, and patterns already in use
162
+ Step 2: Project docs → README, docs/, inline comments, `.specs/STATE.md` (Decisions)
163
+ Step 3: Context7 MCP → resolve library ID, then query for current API/patterns
164
+ Step 4: Web search → official docs, reputable sources, community patterns
165
+ Step 5: Flag as uncertain → "I'm not certain about X - here's my reasoning, but verify"
166
+ ```
167
+
168
+ **Rules:**
169
+
170
+ - Never skip to Step 5 if Steps 1-4 are available
171
+ - Step 5 is ALWAYS flagged as uncertain - never presented as fact
172
+ - **NEVER assume or fabricate.** If you cannot find an answer, say "I don't know" or "I couldn't find documentation for this". Inventing APIs, patterns, or behaviors causes cascading failures across design → tasks → implementation. Uncertainty is always preferable to fabrication.
173
+
174
+ ## Output Behavior
175
+
176
+ **Do the work; do not narrate the machinery.** Produce the right artifact for the phase instead of announcing the phase ("I will now run the Specify phase"). The user judges the output, not a play-by-play of the process. This keeps the flow from reading as robotic.
177
+
178
+ **Match effort to the work.** Lightweight steps (feature-level checks, validation, mechanical tasks) do not need top-tier reasoning; heavy steps (complex design, ambiguous features) do. If the harness lets you pick a model per sub-agent, apply the tier rubric in [sub-agents.md](references/sub-agents.md); otherwise proceed and simply invest more care on the heavy steps. Mention this once per session at most, and only if it helps; skip it for an experienced user.
179
+
180
+ **Write generated artifacts in a plain, decided voice.** Specs, ADRs, validation reports, commit messages, and chat summaries follow the writing rules in [coding-principles.md](references/coding-principles.md): lead with the verdict, state decisions definitively, cut filler and mechanical hedging.
181
+
182
+ ## Code Analysis
183
+
184
+ Use available tools with graceful degradation. See [code-analysis.md](references/code-analysis.md).
@@ -0,0 +1,34 @@
1
+ # TLC Spec-Driven Examples
2
+
3
+ ## Specify and implement a small feature
4
+
5
+ User: "Specify feature: add a 'last seen' timestamp to the profile page."
6
+
7
+ Good agent behavior:
8
+
9
+ - Auto-size the work: a ≤3 file change gets a one-line inline spec and skips Design and Tasks.
10
+ - Execute always starts by listing atomic steps inline, and escalates to a formal `tasks.md` only if that listing reveals more than ~5 steps.
11
+ - Derive tests from the spec's acceptance criteria, not the implementation.
12
+ - Make one atomic Conventional Commit per task, with the task marked complete before the commit.
13
+
14
+ ## Full workflow on a complex feature
15
+
16
+ User: "Specify feature: credit-based usage billing with metering and invoicing."
17
+
18
+ Good agent behavior:
19
+
20
+ - Run the full Specify → Design → Tasks → Execute cycle with requirement IDs in EARS notation.
21
+ - Trigger discuss for gray areas (refunds, proration) and write decisions to `context.md`.
22
+ - Run `validate_spec.py` and `validate_tasks.py` before confirming artifacts, and `check_commit.py` on each commit.
23
+ - Offer sub-agents for batches over ~8 tasks, then let the orchestrator dispatch a fresh Verifier after the final commit.
24
+ - Write the Verifier's `validation.md` with per-AC evidence and the discrimination sensor result.
25
+
26
+ ## Resume work
27
+
28
+ User: "Resume work."
29
+
30
+ Good agent behavior:
31
+
32
+ - Read `.specs/STATE.md` and reconcile the Handoff against git (`branch`, `status --porcelain`, recent commits) and `tasks.md`.
33
+ - Let evidence win over a stale snapshot when they disagree.
34
+ - Propose the reconciled next step before writing any code.
@@ -0,0 +1,98 @@
1
+ # Code Analysis Tools
2
+
3
+ Use graceful degradation for code search and structural analysis.
4
+
5
+ ## Tool Priority
6
+
7
+ 1. **ast-grep** (`sg`) - Structural pattern-based search
8
+ 2. **ripgrep** (`rg`) - Fast context-aware text search
9
+ 3. **grep** - Standard text search (always available)
10
+
11
+ ## Detection
12
+
13
+ Check tool availability before use:
14
+
15
+ ```bash
16
+ # Check for ast-grep
17
+ if command -v sg >/dev/null 2>&1; then
18
+ # Use ast-grep for structural search
19
+ elif command -v rg >/dev/null 2>&1; then
20
+ # Fall back to ripgrep
21
+ else
22
+ # Use standard grep as final fallback
23
+ fi
24
+ ```
25
+
26
+ ## Usage Examples
27
+
28
+ **Finding function definitions:**
29
+
30
+ ```bash
31
+ # ast-grep (best - structural)
32
+ sg -p 'function $NAME($$$) { $$$ }'
33
+
34
+ # ripgrep (fallback - fast text)
35
+ rg '^function\s+\w+\(' --type-add 'source:*.[extension]' -t source
36
+
37
+ # grep (last resort - basic)
38
+ grep -r '^function ' --include="*.[extension]"
39
+ ```
40
+
41
+ **Finding imports/requires:**
42
+
43
+ ```bash
44
+ # ast-grep
45
+ sg -p 'import { $$$ } from "$MODULE"'
46
+
47
+ # ripgrep
48
+ rg '^import .* from' --type-add 'source:*.[extension]' -t source
49
+
50
+ # grep
51
+ grep -r '^import ' --include="*.[extension]"
52
+ ```
53
+
54
+ **Finding class/component definitions:**
55
+
56
+ ```bash
57
+ # ast-grep
58
+ sg -p 'class $NAME { $$$ }'
59
+
60
+ # ripgrep
61
+ rg '^(class|export class)\s+\w+' --type-add 'source:*.[extension]' -t source
62
+
63
+ # grep
64
+ grep -r '^class ' --include="*.[extension]"
65
+ ```
66
+
67
+ ## Search Scope
68
+
69
+ **Best practices:**
70
+
71
+ - Limit to source file extensions relevant to project
72
+ - Exclude directories: `node_modules`, `vendor`, `dist`, `build`, `.git`
73
+ - Focus on source directories: `src`, `lib`, `app`
74
+ - Use file type filters when available
75
+
76
+ **Performance tips:**
77
+
78
+ - Use specific patterns over broad searches
79
+ - Limit directory depth with `--max-depth` (ripgrep/grep)
80
+ - Cache results for repeated queries
81
+
82
+ ## Fallback Notice
83
+
84
+ If ast-grep unavailable, display once per session:
85
+
86
+ ```
87
+ ⚠️ ast-grep not detected. Install for more precise structural code analysis.
88
+ https://ast-grep.github.io/guide/quick-start.html
89
+ ```
90
+
91
+ ## When to Use
92
+
93
+ - Finding usage patterns across codebase
94
+ - Identifying code structure and organization
95
+ - Locating function/class/component definitions
96
+ - Analyzing import/dependency patterns
97
+ - Refactoring impact analysis
98
+ - Code navigation in unfamiliar codebases
@@ -0,0 +1,72 @@
1
+ # Coding Principles
2
+
3
+ Behavioral bias, not checklist. Read before every implementation.
4
+
5
+ ---
6
+
7
+ ## Before Coding
8
+
9
+ - State assumptions explicitly. If uncertain, ask.
10
+ - Multiple interpretations exist? Present all-don't pick silently.
11
+ - Simpler approach exists? Say so. Push back when warranted.
12
+ - Something unclear? Stop. Name what's confusing. Ask.
13
+ - User's approach seems wrong? Disagree honestly. Don't be sycophantic.
14
+
15
+ ---
16
+
17
+ ## During Implementation
18
+
19
+ ### Simplicity
20
+
21
+ - No features beyond what was asked
22
+ - No abstractions for single-use code
23
+ - No "flexibility" or "configurability" not requested
24
+ - No error handling for impossible scenarios
25
+ - 200 lines that could be 50? Rewrite it.
26
+
27
+ ### Surgical Changes
28
+
29
+ - Don't "improve" adjacent code, comments, or formatting
30
+ - Don't refactor things that aren't broken
31
+ - Match existing style, even if you'd do differently
32
+ - Unrelated dead code noticed? Mention it-don't delete it
33
+ - Remove ONLY imports/variables/functions YOUR changes orphaned
34
+ - Don't remove pre-existing dead code unless asked
35
+
36
+ ### Test Integrity
37
+
38
+ - NEVER weaken an existing test assertion to make it pass
39
+ - NEVER delete a test to reduce failure count
40
+ - NEVER use the test framework's skip/disable/pending mechanism to bypass a failing test
41
+ - NEVER modify a task's tests afterward to make the implementation pass
42
+ - If a test is genuinely wrong, STOP and confirm with the user before changing it
43
+ - Tests are the spec - implementation conforms to tests, not the other way around
44
+
45
+ ### Goal-Driven
46
+
47
+ - Transform vague tasks into verifiable goals
48
+ - Multi-step work? State brief plan with verify checkpoints
49
+ - Every changed line must trace directly to user's request
50
+
51
+ ---
52
+
53
+ ## After Each Change
54
+
55
+ Ask: "Would senior engineer call this overcomplicated?"
56
+ If yes → simplify before proceeding.
57
+
58
+ ---
59
+
60
+ ## Writing Voice (specs, ADRs, reports, commits, summaries)
61
+
62
+ The artifacts this skill produces should read like a decided engineer wrote them, not like generated boilerplate.
63
+
64
+ - **Lead with the verdict.** Validation reports and chat summaries open with PASS/FAIL and the one thing that matters, not a warm-up paragraph.
65
+ - **Decisions are definitive.** An ADR or a recorded decision states what you chose: "we will", not "we might" or "we should probably". If it still hedges, it is not a decision yet.
66
+ - **Cut filler and mechanical hedging.** Drop "it is worth noting", "as you can see", "in order to", and reflexive "may/might/could" on claims you are actually sure about. Reserve hedging for genuine uncertainty; using it everywhere signals nothing.
67
+ - **One idea per sentence; short sentences.** Prefer the plain verb over the nominalization ("evaluated", not "performed an evaluation of"). Keep subject-verb-object near the front.
68
+ - **Do not announce the phase.** Produce the artifact; do not narrate "I will now run Specify."
69
+ - **Avoid the em dash as a default connector.** A comma, colon, or two sentences usually read cleaner.
70
+ - **Writing in Portuguese:** keep sentences short; do not carry the long, multi-clause subordinate structure of Portuguese into the artifact. Plain and direct beats formal.
71
+
72
+ None of this means dumbing down the content - only the prose carrying it.
@@ -0,0 +1,31 @@
1
+ # Context Limits
2
+
3
+ ## File Size Limits
4
+
5
+ | File | Max Tokens | ~Words | Warning At |
6
+ | --------- | ---------- | ------ | ---------- |
7
+ | spec.md | 5,000 | 3,000 | 4,000 |
8
+ | design.md | 8,000 | 4,800 | 6,400 |
9
+ | tasks.md | 10,000 | 6,000 | 8,000 |
10
+
11
+ ## Context Zones
12
+
13
+ 🟢 **Healthy** (<40k total): Silent
14
+ 🟡 **Moderate** (40-60k): Discrete footer note
15
+ 🔴 **Critical** (>60k): Active warning, suggest optimization
16
+
17
+ ## Monitoring
18
+
19
+ Display context status in footer when >40k:
20
+
21
+ ```
22
+ 📊 Context: 52k tokens (moderate)
23
+ - tasks.md: 11k (ok)
24
+ - design.md: 6k (ok)
25
+ - Total: 52k / 200k (26%)
26
+ ```
27
+
28
+ ## Principles
29
+
30
+ **Target:** <40k tokens loaded (20% of window)
31
+ **Reserve:** 160k+ tokens for work, reasoning, outputs
@@ -0,0 +1,199 @@
1
+ # Design
2
+
3
+ **Goal**: Define HOW to build it. Architecture, components, what to reuse.
4
+
5
+ **Skip this phase when:** The change is straightforward - no architectural decisions, no new patterns, no component interactions to plan. For simple features, design happens inline during Execute.
6
+
7
+ ## Process
8
+
9
+ ### 1. Load Context
10
+
11
+ Read `.specs/features/[feature]/spec.md` before designing. If `.specs/features/[feature]/context.md` exists, load it too - it contains implementation decisions that constrain the design (layout choices, behavior preferences, interaction patterns). Decisions marked as "Agent's Discretion" are yours to decide.
12
+
13
+ **Mandatory: read `.specs/STATE.md` `## Decisions` now.** This MUST happen before any architectural choices are made. Every `active` `AD-NNN` entry is a project-level constraint this design must conform to. If a decision from a prior feature conflicts with what is best for this feature, you have two options - both require an explicit choice:
14
+
15
+ 1. **Conform** - Design within the active constraint.
16
+ 2. **Supersede** - Append a new `AD-NNN` entry to `.specs/STATE.md` `## Decisions` that supersedes the old one (set the old entry's `status` to `superseded by AD-NNN`) and document the reason. The new decision becomes the project standard going forward.
17
+
18
+ Silently ignoring an active decision is not an option - it creates invisible inconsistency across features.
19
+
20
+ **Also load confirmed lessons** relevant to this feature: `python3 <skill-dir>/scripts/lessons.py list --status confirmed` (filter with `--scope`/`--query`). These are past verification failures distilled into guidance - apply them while designing. Load only `confirmed`. Skip silently if no store or no code tool. See [lessons.md](lessons.md).
21
+
22
+ ### 1.5. Research (Optional but Recommended)
23
+
24
+ If the feature involves unfamiliar technology, patterns, or integrations, research before designing. Document findings briefly in the design doc or as inline notes. This prevents incorrect assumptions from propagating into tasks.
25
+
26
+ Follow the **Knowledge Verification Chain** (see SKILL.md) in strict order:
27
+
28
+ ```
29
+ Codebase → Project docs → Context7 MCP → Web search → Flag as uncertain
30
+ ```
31
+
32
+ **CRITICAL: NEVER assume or fabricate information.** If you cannot find an answer through the chain, explicitly say "I don't know" or "I couldn't find documentation for this". Inventing an API, a pattern, or a behavior that doesn't exist is far worse than admitting uncertainty. Wrong assumptions propagate through design → tasks → implementation and cause cascading failures.
33
+
34
+ Good triggers for research: new libraries, unfamiliar APIs, performance-sensitive features, security-sensitive features, patterns you haven't used in this codebase before.
35
+
36
+ **Concern flagging (MUST do while reading code):** While walking the codebase via the Knowledge Verification Chain, flag any concerns you encounter in the areas this feature touches. Capture each finding in the `## Risks & Concerns` section of `design.md`:
37
+
38
+ - **Fragile code** - tight coupling, large functions, implicit state
39
+ - **Tech debt** - hacks, workarounds, deprecated APIs
40
+ - **Security risks** - unvalidated input, auth gaps, exposed secrets
41
+ - **Performance bottlenecks** - N+1 queries, unbounded loops, missing indexes
42
+ - **Test coverage gaps** - untested paths the feature depends on
43
+
44
+ Every flagged concern MUST include a mitigation - how the design (or a follow-up task) addresses it.
45
+
46
+ ### 2. Define Architecture
47
+
48
+ **Large/Complex only - approach exploration:** Before committing to a single architecture, present 2-3 viable approaches with trade-offs and a recommendation. Lead with the recommendation to avoid analysis paralysis. All approaches must deliver the same scoped thing (no alternative scopes). Confirm the chosen approach with the user before detailing components. Medium features: skip - design inline.
49
+
50
+ Overview of how components interact. Use mermaid diagrams when helpful.
51
+
52
+ ### 3. Identify Code Reuse
53
+
54
+ **CRITICAL**: What existing code can we leverage? This saves tokens and reduces errors.
55
+
56
+ Flag any concerns found here per step 1.5 into `## Risks & Concerns`.
57
+
58
+ ### 4. Define Components and Interfaces
59
+
60
+ Each component: Purpose, Location, Interfaces, Dependencies, What it reuses.
61
+
62
+ ### 5. Define Data Models
63
+
64
+ If the feature involves data, define models before implementation.
65
+
66
+ ---
67
+
68
+ ## Template: `.specs/features/[feature]/design.md`
69
+
70
+ ````markdown
71
+ # [Feature] Design
72
+
73
+ **Spec**: `.specs/features/[feature]/spec.md`
74
+ **Status**: Draft | Approved
75
+
76
+ ---
77
+
78
+ ## Architecture Overview
79
+
80
+ [Brief description of the architecture approach]
81
+
82
+ ```mermaid
83
+ graph TD
84
+ A[User Action] --> B[Component A]
85
+ B --> C[Service Layer]
86
+ C --> D[Data Store]
87
+ B --> E[Component B]
88
+ ```
89
+ ````
90
+
91
+ ---
92
+
93
+ ## Code Reuse Analysis
94
+
95
+ ### Existing Components to Leverage
96
+
97
+ | Component | Location | How to Use |
98
+ | -------------------- | ------------------- | ------------------------- |
99
+ | [Existing Component] | `src/path/to/file` | [Extend/Import/Reference] |
100
+ | [Existing Utility] | `src/utils/file` | [How it helps] |
101
+ | [Existing Pattern] | `src/patterns/file` | [Apply same pattern] |
102
+
103
+ ### Integration Points
104
+
105
+ | System | Integration Method |
106
+ | -------------- | --------------------------------------- |
107
+ | [Existing API] | [How new feature connects] |
108
+ | [Database] | [How data connects to existing schemas] |
109
+
110
+ ---
111
+
112
+ ## Components
113
+
114
+ ### [Component Name]
115
+
116
+ - **Purpose**: [What this component does - one sentence]
117
+ - **Location**: `src/path/to/component/`
118
+ - **Interfaces**:
119
+ - `methodName(param: Type): ReturnType` - [description]
120
+ - `methodName(param: Type): ReturnType` - [description]
121
+ - **Dependencies**: [What it needs to function]
122
+ - **Reuses**: [Existing code this builds upon]
123
+
124
+ ### [Component Name]
125
+
126
+ - **Purpose**: [What this component does]
127
+ - **Location**: `src/path/to/component/`
128
+ - **Interfaces**:
129
+ - `methodName(param: Type): ReturnType`
130
+ - **Dependencies**: [Dependencies]
131
+ - **Reuses**: [Existing code]
132
+
133
+ ---
134
+
135
+ ## Data Models (if applicable)
136
+
137
+ ### [Model Name]
138
+
139
+ ```typescript
140
+ interface ModelName {
141
+ id: string
142
+ field1: string
143
+ field2: number
144
+ createdAt: Date
145
+ }
146
+ ```
147
+
148
+ **Relationships**: [How this relates to other models]
149
+
150
+ ### [Model Name]
151
+
152
+ ```typescript
153
+ interface AnotherModel {
154
+ id: string
155
+ // ...
156
+ }
157
+ ```
158
+
159
+ ---
160
+
161
+ ## Error Handling Strategy
162
+
163
+ | Error Scenario | Handling | User Impact |
164
+ | -------------- | ------------- | ---------------- |
165
+ | [Scenario 1] | [How handled] | [What user sees] |
166
+ | [Scenario 2] | [How handled] | [What user sees] |
167
+
168
+ ---
169
+
170
+ ## Risks & Concerns
171
+
172
+ | Concern | Location (file:line) | Impact | Mitigation |
173
+ | ------- | -------------------- | ------ | ---------- |
174
+ | [Fragile code / tech debt / security / perf / test gap] | `src/path/file.ts:42` | [What breaks or degrades] | [How the design or a follow-up task addresses it] |
175
+
176
+ > None found - is a valid entry.
177
+
178
+ ---
179
+
180
+ ## Tech Decisions (only non-obvious ones)
181
+
182
+ | Decision | Choice | Rationale |
183
+ | ----------------- | --------------- | ------------- |
184
+ | [What we decided] | [What we chose] | [Why - brief] |
185
+
186
+ > **Project-level decisions:** If a decision here sets a convention, pattern, or constraint that future features must follow, append it to `.specs/STATE.md` `## Decisions` as the next `AD-NNN` entry (see [memory.md](memory.md)). Feature-local decisions stay only in this table.
187
+
188
+ ---
189
+
190
+ ## Tips
191
+
192
+ - **Load context first** - If context.md exists, decisions there are locked
193
+ - **Research when uncertain** - 5 minutes of research prevents hours of rework
194
+ - **Reuse is king** - Every component should reference existing patterns
195
+ - **Interfaces first** - Define contracts before implementation
196
+ - **Keep it visual** - Diagrams save 1000 words
197
+ - **Small components** - If component does 3+ things, split it
198
+ - **Flag concerns inline** - Risks found during research go in Risks & Concerns with a mitigation
199
+ - **Confirm before Tasks** - User approves design before breaking into tasks